@rogieking/figui3 6.23.0 → 6.23.2

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/fig.js CHANGED
@@ -282,7 +282,7 @@ function figUniqueId() {
282
282
  }
283
283
 
284
284
  /** Zero-size portal for fixed overlays so they never affect body layout metrics. */
285
- function figGetOverlayRoot(source) {
285
+ function figGetOverlayRoot() {
286
286
  if (!document.body) return null;
287
287
  const attr = "data-figui-overlay-root";
288
288
  let root = document.body.querySelector(`:scope > [${attr}]`);
@@ -291,40 +291,9 @@ function figGetOverlayRoot(source) {
291
291
  root.setAttribute(attr, "");
292
292
  document.body.append(root);
293
293
  }
294
- figSyncOverlayThemeFromSource(root, source);
295
294
  return root;
296
295
  }
297
296
 
298
- /** Copy PropsKit / FigUI theme onto the overlay portal so portaled popups stay themed. */
299
- function figSyncOverlayThemeFromSource(overlayRoot, source) {
300
- if (!overlayRoot) return;
301
- const panel =
302
- (source instanceof Element
303
- ? source.closest(".figui-root")
304
- : null) || document.querySelector(".figui-root");
305
- if (!panel) return;
306
-
307
- const themeAttr = panel.getAttribute("theme");
308
- const theme =
309
- themeAttr === "light" || themeAttr === "dark" || themeAttr === "system"
310
- ? themeAttr
311
- : panel.classList.contains("figma-dark")
312
- ? "dark"
313
- : panel.classList.contains("figma-light")
314
- ? "light"
315
- : "system";
316
-
317
- overlayRoot.classList.toggle("figma-light", theme === "light");
318
- overlayRoot.classList.toggle("figma-dark", theme === "dark");
319
- if (theme === "system") {
320
- overlayRoot.style.setProperty("color-scheme", "light dark");
321
- } else {
322
- overlayRoot.style.setProperty("color-scheme", theme);
323
- }
324
- if (themeAttr) overlayRoot.setAttribute("theme", theme);
325
- else overlayRoot.removeAttribute("theme");
326
- }
327
-
328
297
  let _figZCounter = 10000;
329
298
  function figGetHighestZIndex() {
330
299
  return _figZCounter++;
@@ -1113,13 +1082,13 @@ class FigTooltip extends HTMLElement {
1113
1082
  // - Without popover support, fall back to today's behavior: nearest open
1114
1083
  // <dialog> ancestor if present, else document.body.
1115
1084
  if (supportsPopover) {
1116
- (figGetOverlayRoot(this) ?? document.body).append(this.popup);
1085
+ (figGetOverlayRoot() ?? document.body).append(this.popup);
1117
1086
  } else {
1118
1087
  const parentDialog = this.closest("dialog");
1119
1088
  if (parentDialog && parentDialog.open) {
1120
1089
  parentDialog.append(this.popup);
1121
1090
  } else {
1122
- (figGetOverlayRoot(this) ?? document.body).append(this.popup);
1091
+ (figGetOverlayRoot() ?? document.body).append(this.popup);
1123
1092
  }
1124
1093
  }
1125
1094
 
@@ -1511,13 +1480,13 @@ class FigTooltip extends HTMLElement {
1511
1480
  popup.append(content);
1512
1481
 
1513
1482
  if (supportsPopover) {
1514
- (figGetOverlayRoot(anchor) ?? document.body).append(popup);
1483
+ (figGetOverlayRoot() ?? document.body).append(popup);
1515
1484
  } else {
1516
1485
  const parentDialog = anchor.closest?.("dialog");
1517
1486
  if (parentDialog && parentDialog.open) {
1518
1487
  parentDialog.append(popup);
1519
1488
  } else {
1520
- (figGetOverlayRoot(anchor) ?? document.body).append(popup);
1489
+ (figGetOverlayRoot() ?? document.body).append(popup);
1521
1490
  }
1522
1491
  }
1523
1492
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rogieking/figui3",
3
- "version": "6.23.0",
3
+ "version": "6.23.2",
4
4
  "description": "A lightweight web components library for building Figma plugin and widget UIs with native look and feel",
5
5
  "author": "Rogie King",
6
6
  "license": "MIT",
@@ -19,15 +19,6 @@
19
19
  "./fig-lab.css": "./dist/fig-lab.css",
20
20
  "./base.css": "./dist/base.css",
21
21
  "./components.css": "./dist/components.css",
22
- "./propskit": {
23
- "types": "./propskit.d.ts",
24
- "default": "./dist/propskit.js"
25
- },
26
- "./propskit.js": {
27
- "types": "./propskit.d.ts",
28
- "default": "./dist/propskit.js"
29
- },
30
- "./propskit.css": "./dist/propskit.css",
31
22
  "./src/fig.js": "./fig.js",
32
23
  "./src/fig-layer.js": "./fig-layer.js",
33
24
  "./src/fig-editor.js": "./fig-editor.js",
@@ -44,9 +35,6 @@
44
35
  "fig-layer.js",
45
36
  "fig-editor.js",
46
37
  "fig-lab.js",
47
- "propskit.js",
48
- "propskit-core.js",
49
- "propskit.d.ts",
50
38
  "fig.css",
51
39
  "fig-layer.css",
52
40
  "fig-editor.css",
@@ -61,17 +49,14 @@
61
49
  ],
62
50
  "sideEffects": [
63
51
  "*.css",
64
- "./propskit.js",
65
- "./dist/propskit.js",
66
52
  "./fig.js",
67
53
  "./fig-lab.js",
68
54
  "./fig-editor.js"
69
55
  ],
70
56
  "scripts": {
71
57
  "dev": "bun --hot server.ts",
72
- "build": "bun build fig.js --minify --outdir dist && bun build fig-layer.js --minify --outdir dist && bun build fig-editor.js --minify --outdir dist --external ./fig.js --external ./fig-lab.js && bun build fig-lab.js --minify --outdir dist --external ./fig.js --external ./fig-editor.js && bun build propskit.js --minify --outdir dist --external ./fig.js --external ./fig-lab.js --external ./fig-editor.js && npm run build:css && npm run build:propskit-css",
58
+ "build": "bun build fig.js --minify --outdir dist && bun build fig-layer.js --minify --outdir dist && bun build fig-editor.js --minify --outdir dist --external ./fig.js --external ./fig-lab.js && bun build fig-lab.js --minify --outdir dist --external ./fig.js --external ./fig-editor.js && npm run build:css",
73
59
  "build:css": "node scripts/build-css.mjs",
74
- "build:propskit-css": "node scripts/build-propskit-css.mjs",
75
60
  "dev:playground": "node playground/dev.mjs",
76
61
  "build:playground": "cd playground && npm run build",
77
62
  "test": "npm run test:components",
@@ -125,17 +110,6 @@
125
110
  "playwright": "^1.58.2"
126
111
  },
127
112
  "peerDependencies": {
128
- "typescript": "^5.0.0",
129
- "react": ">=18",
130
- "vue": ">=3.3",
131
- "svelte": ">=5",
132
- "solid-js": ">=1.8"
133
- },
134
- "peerDependenciesMeta": {
135
- "react": { "optional": true },
136
- "vue": { "optional": true },
137
- "svelte": { "optional": true },
138
- "solid-js": { "optional": true },
139
- "typescript": { "optional": true }
113
+ "typescript": "^5.0.0"
140
114
  }
141
115
  }