Skip to content

Commit ff917b9

Browse files
disable button detection
1 parent 7ac0e19 commit ff917b9

1 file changed

Lines changed: 19 additions & 12 deletions

File tree

packages/designto-token/main.ts

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import { nodes } from "@design-sdk/core";
22
import { Widget } from "@reflect-ui/core";
3+
import type { Blurred, Opacity, Rotation } from "@reflect-ui/core";
4+
import type { Stretched } from "./tokens";
35
import { tokenizeText } from "./token-text";
46
import { tokenizeLayout } from "./token-layout";
57
import { tokenizeContainer } from "./token-container";
@@ -167,10 +169,11 @@ function handleNode(
167169
}
168170

169171
// - button -
170-
const _detect_if_button = detectIf.button(node);
171-
if (_detect_if_button.result) {
172-
return tokenizeButton.fromManifest(node, _detect_if_button.data);
173-
}
172+
// TODO: this causes confliction with flags
173+
// const _detect_if_button = detectIf.button(node);
174+
// if (_detect_if_button.result) {
175+
// return tokenizeButton.fromManifest(node, _detect_if_button.data);
176+
// }
174177
}
175178
// -------------------------------------------------------------------------
176179
// --------------------------- Detected tokens -----------------------------
@@ -233,33 +236,37 @@ function handleNode(
233236
return tokenizedTarget;
234237
}
235238

236-
function post_wrap(node: nodes.ReflectSceneNode, tokenizedTarget: Widget) {
237-
if (tokenizedTarget) {
239+
export function post_wrap(
240+
node: nodes.ReflectSceneNode,
241+
tokenizedTarget: Widget
242+
): Widget | Stretched | Opacity | Blurred | Rotation {
243+
let wrapped = tokenizedTarget;
244+
if (wrapped) {
238245
if (hasStretching(node)) {
239-
tokenizedTarget = wrap_with_stretched(node, tokenizedTarget);
246+
wrapped = wrap_with_stretched(node, wrapped);
240247
}
241248
}
242249

243250
if (hasDimmedOpacity(node)) {
244-
tokenizedTarget = wrap_with_opacity(node, tokenizedTarget);
251+
wrapped = wrap_with_opacity(node, wrapped);
245252
}
246253

247254
node.effects.map((d) => {
248255
const blurEffect = hasBlurType(d);
249256
if (blurEffect) {
250257
if (hasLayerBlurType(blurEffect)) {
251-
tokenizedTarget = wrap_with_layer_blur(node, tokenizedTarget);
258+
wrapped = wrap_with_layer_blur(node, wrapped);
252259
} else if (hasBackgroundBlurType(blurEffect)) {
253-
tokenizedTarget = wrap_with_background_blur(node, tokenizedTarget);
260+
wrapped = wrap_with_background_blur(node, wrapped);
254261
}
255262
}
256263
});
257264

258265
if (hasRotation(node)) {
259-
tokenizedTarget = wrap_with_rotation(node, tokenizedTarget);
266+
wrapped = wrap_with_rotation(node, wrapped);
260267
}
261268

262-
return tokenizedTarget;
269+
return wrapped;
263270
}
264271

265272
function handle_by_types(

0 commit comments

Comments
 (0)