@toghen/figma 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cli/figcraftApply.ts +9 -0
- package/component-files.md +1 -1
- package/dist/code.js +173 -159
- package/dist/ui.html +12 -12
- package/package.json +1 -1
- package/shared/components/validate.ts +17 -0
package/dist/ui.html
CHANGED
|
@@ -3593,13 +3593,13 @@ tg-pane-apply tg-row [data-part="value"] [data-goto] {
|
|
|
3593
3593
|
};
|
|
3594
3594
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
3595
3595
|
|
|
3596
|
-
//
|
|
3596
|
+
// node_modules/.pnpm/@toghen+ui@0.1.0/node_modules/@toghen/ui/src/define.js
|
|
3597
3597
|
function define(name, build) {
|
|
3598
3598
|
if (typeof customElements === "undefined" || customElements.get(name)) return;
|
|
3599
3599
|
customElements.define(name, build());
|
|
3600
3600
|
}
|
|
3601
3601
|
|
|
3602
|
-
//
|
|
3602
|
+
// node_modules/.pnpm/@toghen+ui@0.1.0/node_modules/@toghen/ui/src/components/dot.js
|
|
3603
3603
|
var DOT_WORDS = {
|
|
3604
3604
|
drifted: "drifted",
|
|
3605
3605
|
upstream: "drifted upstream",
|
|
@@ -3637,7 +3637,7 @@ tg-pane-apply tg-row [data-part="value"] [data-goto] {
|
|
|
3637
3637
|
}
|
|
3638
3638
|
);
|
|
3639
3639
|
|
|
3640
|
-
//
|
|
3640
|
+
// node_modules/.pnpm/@toghen+ui@0.1.0/node_modules/@toghen/ui/src/keys.js
|
|
3641
3641
|
var isActivationKey = (key) => key === "Enter" || key === " ";
|
|
3642
3642
|
var optionAction = (key) => key === " " ? "select" : key === "Enter" ? "activate" : null;
|
|
3643
3643
|
var STEP = {
|
|
@@ -3676,7 +3676,7 @@ tg-pane-apply tg-row [data-part="value"] [data-goto] {
|
|
|
3676
3676
|
return enabled.indexOf(true);
|
|
3677
3677
|
}
|
|
3678
3678
|
|
|
3679
|
-
//
|
|
3679
|
+
// node_modules/.pnpm/@toghen+ui@0.1.0/node_modules/@toghen/ui/src/components/chip.js
|
|
3680
3680
|
define(
|
|
3681
3681
|
"tg-chip",
|
|
3682
3682
|
() => class TgChip extends HTMLElement {
|
|
@@ -3707,7 +3707,7 @@ tg-pane-apply tg-row [data-part="value"] [data-goto] {
|
|
|
3707
3707
|
}
|
|
3708
3708
|
);
|
|
3709
3709
|
|
|
3710
|
-
//
|
|
3710
|
+
// node_modules/.pnpm/@toghen+ui@0.1.0/node_modules/@toghen/ui/src/components/choice.js
|
|
3711
3711
|
function attachChoice(host, { role, itemRole, chosen, pattern, items: selector = ":scope > button", orientation: fallback = "horizontal", activates = false }) {
|
|
3712
3712
|
const items = () => [...host.querySelectorAll(selector)];
|
|
3713
3713
|
const isEnabled = (item) => item.getAttribute("aria-disabled") !== "true" && !item.disabled;
|
|
@@ -3788,7 +3788,7 @@ tg-pane-apply tg-row [data-part="value"] [data-goto] {
|
|
|
3788
3788
|
};
|
|
3789
3789
|
}
|
|
3790
3790
|
|
|
3791
|
-
//
|
|
3791
|
+
// node_modules/.pnpm/@toghen+ui@0.1.0/node_modules/@toghen/ui/src/components/segmented.js
|
|
3792
3792
|
define(
|
|
3793
3793
|
"tg-segmented",
|
|
3794
3794
|
() => class TgSegmented extends HTMLElement {
|
|
@@ -3802,7 +3802,7 @@ tg-pane-apply tg-row [data-part="value"] [data-goto] {
|
|
|
3802
3802
|
}
|
|
3803
3803
|
);
|
|
3804
3804
|
|
|
3805
|
-
//
|
|
3805
|
+
// node_modules/.pnpm/@toghen+ui@0.1.0/node_modules/@toghen/ui/src/components/tabs.js
|
|
3806
3806
|
define(
|
|
3807
3807
|
"tg-tabs",
|
|
3808
3808
|
() => class TgTabs extends HTMLElement {
|
|
@@ -3816,7 +3816,7 @@ tg-pane-apply tg-row [data-part="value"] [data-goto] {
|
|
|
3816
3816
|
}
|
|
3817
3817
|
);
|
|
3818
3818
|
|
|
3819
|
-
//
|
|
3819
|
+
// node_modules/.pnpm/@toghen+ui@0.1.0/node_modules/@toghen/ui/src/icons.js
|
|
3820
3820
|
var GLYPHS = {
|
|
3821
3821
|
token: "diamond",
|
|
3822
3822
|
variable: "hexagon",
|
|
@@ -3855,7 +3855,7 @@ tg-pane-apply tg-row [data-part="value"] [data-goto] {
|
|
|
3855
3855
|
return `<i class="tg-icon ph ph-${phosphor}"${tone ? ` data-tone="${tone}"` : ""}${size ? ` data-size="${size}"` : ""} aria-hidden="true"></i>`;
|
|
3856
3856
|
}
|
|
3857
3857
|
|
|
3858
|
-
//
|
|
3858
|
+
// node_modules/.pnpm/@toghen+ui@0.1.0/node_modules/@toghen/ui/src/components/callout.js
|
|
3859
3859
|
function calloutMark(tone) {
|
|
3860
3860
|
if (tone === "warn") return { dot: "drifted" };
|
|
3861
3861
|
if (tone === "err") return { icon: ICONS.warning };
|
|
@@ -3888,7 +3888,7 @@ tg-pane-apply tg-row [data-part="value"] [data-goto] {
|
|
|
3888
3888
|
}
|
|
3889
3889
|
);
|
|
3890
3890
|
|
|
3891
|
-
//
|
|
3891
|
+
// node_modules/.pnpm/@toghen+ui@0.1.0/node_modules/@toghen/ui/src/components/card.js
|
|
3892
3892
|
define(
|
|
3893
3893
|
"tg-card",
|
|
3894
3894
|
() => class TgCard extends HTMLElement {
|
|
@@ -3904,7 +3904,7 @@ tg-pane-apply tg-row [data-part="value"] [data-goto] {
|
|
|
3904
3904
|
}
|
|
3905
3905
|
);
|
|
3906
3906
|
|
|
3907
|
-
//
|
|
3907
|
+
// node_modules/.pnpm/@toghen+ui@0.1.0/node_modules/@toghen/ui/src/components/row.js
|
|
3908
3908
|
var serial = 0;
|
|
3909
3909
|
define(
|
|
3910
3910
|
"tg-row",
|
|
@@ -3971,7 +3971,7 @@ tg-pane-apply tg-row [data-part="value"] [data-goto] {
|
|
|
3971
3971
|
}
|
|
3972
3972
|
);
|
|
3973
3973
|
|
|
3974
|
-
//
|
|
3974
|
+
// node_modules/.pnpm/@toghen+ui@0.1.0/node_modules/@toghen/ui/src/components/list.js
|
|
3975
3975
|
define(
|
|
3976
3976
|
"tg-list",
|
|
3977
3977
|
() => class TgList extends HTMLElement {
|
package/package.json
CHANGED
|
@@ -103,6 +103,23 @@ export function checkLayout(layer: Layer, parent: Layer | undefined, report: Rep
|
|
|
103
103
|
);
|
|
104
104
|
}
|
|
105
105
|
|
|
106
|
+
// A frame that hugs an axis its children only fill has nothing to size it by: the target sets one of the two back
|
|
107
|
+
// (FigCraft 0.10.0 sets the child to FIXED, measured 25 October 2026), so every later run finds the file's value changed.
|
|
108
|
+
if (mode === 'HORIZONTAL' || mode === 'VERTICAL') {
|
|
109
|
+
for (const [sizing, axis] of [
|
|
110
|
+
['layoutSizingHorizontal', 'width'],
|
|
111
|
+
['layoutSizingVertical', 'height'],
|
|
112
|
+
] as const) {
|
|
113
|
+
if (plain(layer, sizing) !== 'HUG') continue;
|
|
114
|
+
const flow = layer.children.filter((child) => plain(child, 'layoutPositioning') !== 'ABSOLUTE');
|
|
115
|
+
if (flow.length === 0 || !flow.every((child) => plain(child, sizing) === 'FILL')) continue;
|
|
116
|
+
report.error(
|
|
117
|
+
`${flow.map(describe).join(', ')} ${flow.length === 1 ? 'fills' : 'fill'} the ${axis} of ${what}, which hugs it: a frame cannot hug children that only fill it; give "${layer.address}" a fixed ${axis}, or a child a ${axis} of its own`,
|
|
118
|
+
fieldAt(flow[0], sizing),
|
|
119
|
+
);
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
|
|
106
123
|
if (mode === 'GRID') {
|
|
107
124
|
for (const field of ['gridRowSizes', 'gridColumnSizes']) {
|
|
108
125
|
if (!(field in layer.fields)) report.error(`${what} is a GRID and needs ${field}`, layer.loc);
|