@reopt-ai/opt-devtool 1.0.0 → 1.0.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/CHANGELOG.md +22 -0
- package/README.md +11 -2
- package/dist/brandapp/index.cjs +457 -363
- package/dist/brandapp/index.d.cts +80 -81
- package/dist/brandapp/index.d.ts +80 -81
- package/dist/brandapp/index.js +451 -361
- package/dist/datagrid/index.cjs +170 -180
- package/dist/datagrid/index.d.cts +9 -11
- package/dist/datagrid/index.d.ts +9 -11
- package/dist/datagrid/index.js +167 -179
- package/dist/editor/index.cjs +209 -228
- package/dist/editor/index.d.cts +9 -11
- package/dist/editor/index.d.ts +9 -11
- package/dist/editor/index.js +206 -227
- package/dist/harness/index.cjs +5 -12
- package/dist/harness/index.d.cts +14 -16
- package/dist/harness/index.d.ts +14 -16
- package/dist/harness/index.js +1 -11
- package/dist/harness-CJZXBH3w.js +528 -0
- package/dist/harness-CPOp9Wlj.cjs +582 -0
- package/dist/index.cjs +3619 -3782
- package/dist/index.d.cts +9 -17
- package/dist/index.d.ts +9 -17
- package/dist/index.js +3611 -3781
- package/dist/provider-Cjg2rSYG.js +110 -0
- package/dist/provider-H53ZWHCo.cjs +161 -0
- package/dist/theme/index.cjs +298 -12
- package/dist/theme/index.d.cts +26 -28
- package/dist/theme/index.d.ts +26 -28
- package/dist/theme/index.js +294 -11
- package/dist/theme-isolate-BOo3J259.js +42 -0
- package/dist/theme-isolate-D9AMkYrD.cjs +53 -0
- package/dist/types-BKmW0EBr.js +4 -0
- package/dist/types-Bz4DijhU.cjs +9 -0
- package/dist/types-D_lNT2Nr.d.cts +91 -0
- package/dist/types-D_lNT2Nr.d.ts +91 -0
- package/dist/ui/index.cjs +4 -8
- package/dist/ui/index.d.cts +3 -2
- package/dist/ui/index.d.ts +3 -2
- package/dist/ui/index.js +1 -7
- package/package.json +4 -4
- package/dist/chunk-4MJKIAXH.cjs +0 -65
- package/dist/chunk-5HRIQSVF.js +0 -32
- package/dist/chunk-6AGUYGVT.cjs +0 -77
- package/dist/chunk-EQPETYJJ.cjs +0 -32
- package/dist/chunk-H3F2WACS.cjs +0 -568
- package/dist/chunk-N7YO56TN.cjs +0 -25
- package/dist/chunk-SQ3E3QLA.cjs +0 -253
- package/dist/chunk-SW2FF6EV.js +0 -568
- package/dist/chunk-UJSIQF3A.js +0 -25
- package/dist/chunk-UQY5I3WS.js +0 -253
- package/dist/chunk-YCYIUFB4.js +0 -65
- package/dist/chunk-Z2KFRHSI.js +0 -77
- package/dist/index-Bakx4o8Z.d.cts +0 -91
- package/dist/index-Bakx4o8Z.d.ts +0 -91
package/dist/chunk-UQY5I3WS.js
DELETED
|
@@ -1,253 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import {
|
|
3
|
-
ISOLATE_STYLE
|
|
4
|
-
} from "./chunk-5HRIQSVF.js";
|
|
5
|
-
import {
|
|
6
|
-
useOptDevtoolPlugin
|
|
7
|
-
} from "./chunk-Z2KFRHSI.js";
|
|
8
|
-
|
|
9
|
-
// src/theme/index.tsx
|
|
10
|
-
import * as React from "react";
|
|
11
|
-
import { contrastRatio, wcagLevel, hexToSrgb } from "@reopt-ai/opt-palette";
|
|
12
|
-
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
13
|
-
var AUDIT_PAIRS = [
|
|
14
|
-
["--opt-text", "--opt-surface"],
|
|
15
|
-
["--opt-accent-fg", "--opt-accent"],
|
|
16
|
-
["--opt-text-secondary", "--opt-surface"]
|
|
17
|
-
];
|
|
18
|
-
function computeContrastPairs(tokens) {
|
|
19
|
-
const results = [];
|
|
20
|
-
for (const [fgName, bgName] of AUDIT_PAIRS) {
|
|
21
|
-
const fgVal = tokens[fgName];
|
|
22
|
-
const bgVal = tokens[bgName];
|
|
23
|
-
if (!fgVal || !bgVal) continue;
|
|
24
|
-
try {
|
|
25
|
-
const fgRgb = hexToSrgb(fgVal);
|
|
26
|
-
const bgRgb = hexToSrgb(bgVal);
|
|
27
|
-
const ratio = contrastRatio(fgRgb, bgRgb);
|
|
28
|
-
results.push({
|
|
29
|
-
fg: fgName,
|
|
30
|
-
bg: bgName,
|
|
31
|
-
ratio,
|
|
32
|
-
level: wcagLevel(ratio)
|
|
33
|
-
});
|
|
34
|
-
} catch (e) {
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
return results;
|
|
38
|
-
}
|
|
39
|
-
function themeConfigToSnapshot(theme) {
|
|
40
|
-
if (theme.mode === "generated") {
|
|
41
|
-
return {
|
|
42
|
-
mode: theme.mode,
|
|
43
|
-
preset: theme.preset,
|
|
44
|
-
seed: theme.palette.seed,
|
|
45
|
-
harmony: theme.palette.harmony,
|
|
46
|
-
radiusScale: theme.palette.radiusScale,
|
|
47
|
-
shadowIntensity: theme.palette.shadowIntensity,
|
|
48
|
-
neutralTemperature: theme.palette.neutralTemperature,
|
|
49
|
-
forceLightOnly: theme.forceLightOnly,
|
|
50
|
-
lightTokens: theme.generatedLightTokens,
|
|
51
|
-
darkTokens: theme.generatedDarkTokens,
|
|
52
|
-
contrastPairs: computeContrastPairs(theme.generatedLightTokens)
|
|
53
|
-
};
|
|
54
|
-
}
|
|
55
|
-
return {
|
|
56
|
-
mode: theme.mode,
|
|
57
|
-
preset: theme.preset,
|
|
58
|
-
seed: void 0,
|
|
59
|
-
harmony: void 0,
|
|
60
|
-
radiusScale: void 0,
|
|
61
|
-
shadowIntensity: void 0,
|
|
62
|
-
neutralTemperature: void 0,
|
|
63
|
-
forceLightOnly: theme.forceLightOnly,
|
|
64
|
-
lightTokens: void 0,
|
|
65
|
-
darkTokens: void 0,
|
|
66
|
-
contrastPairs: void 0
|
|
67
|
-
};
|
|
68
|
-
}
|
|
69
|
-
var SWATCH_TOKENS = [
|
|
70
|
-
{ token: "--opt-accent", label: "Accent" },
|
|
71
|
-
{ token: "--opt-surface", label: "Surface" },
|
|
72
|
-
{ token: "--opt-text", label: "Text" },
|
|
73
|
-
{ token: "--opt-bg", label: "BG" },
|
|
74
|
-
{ token: "--opt-border", label: "Border" },
|
|
75
|
-
{ token: "--opt-success", label: "OK" },
|
|
76
|
-
{ token: "--opt-warning", label: "Warn" },
|
|
77
|
-
{ token: "--opt-danger", label: "Err" },
|
|
78
|
-
{ token: "--opt-chart-1", label: "C1" },
|
|
79
|
-
{ token: "--opt-chart-2", label: "C2" }
|
|
80
|
-
];
|
|
81
|
-
var CONTRAST_CHECK_PAIRS = [
|
|
82
|
-
{ fg: "--opt-text", bg: "--opt-surface", label: "text/surface" },
|
|
83
|
-
{ fg: "--opt-accent-fg", bg: "--opt-accent", label: "accentFg/accent" },
|
|
84
|
-
{
|
|
85
|
-
fg: "--opt-text-secondary",
|
|
86
|
-
bg: "--opt-surface",
|
|
87
|
-
label: "text2nd/surface"
|
|
88
|
-
}
|
|
89
|
-
];
|
|
90
|
-
function ThemeDevtoolPanel({
|
|
91
|
-
snapshot
|
|
92
|
-
}) {
|
|
93
|
-
if (!snapshot) {
|
|
94
|
-
return /* @__PURE__ */ jsx("div", { className: "text-[11px] text-white/55", children: "Waiting for Theme snapshot." });
|
|
95
|
-
}
|
|
96
|
-
const isGenerated = snapshot.mode === "generated";
|
|
97
|
-
return /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-3 text-[11px]", style: ISOLATE_STYLE, children: [
|
|
98
|
-
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
99
|
-
/* @__PURE__ */ jsx(
|
|
100
|
-
"span",
|
|
101
|
-
{
|
|
102
|
-
className: `inline-block h-1.5 w-1.5 rounded-full ${isGenerated ? "bg-violet-400" : "bg-white/30"}`
|
|
103
|
-
}
|
|
104
|
-
),
|
|
105
|
-
/* @__PURE__ */ jsx("span", { className: isGenerated ? "text-violet-300" : "text-white/60", children: isGenerated ? "Generated" : `Preset: ${snapshot.preset}` }),
|
|
106
|
-
snapshot.forceLightOnly && /* @__PURE__ */ jsx("span", { className: "text-[9px] text-amber-400", children: "light-only" })
|
|
107
|
-
] }),
|
|
108
|
-
isGenerated && snapshot.seed && /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1.5", children: [
|
|
109
|
-
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
110
|
-
/* @__PURE__ */ jsx(
|
|
111
|
-
"div",
|
|
112
|
-
{
|
|
113
|
-
className: "h-5 w-5 rounded border border-white/20",
|
|
114
|
-
style: { backgroundColor: snapshot.seed }
|
|
115
|
-
}
|
|
116
|
-
),
|
|
117
|
-
/* @__PURE__ */ jsx("span", { className: "font-mono text-[10px] text-white/70", children: snapshot.seed })
|
|
118
|
-
] }),
|
|
119
|
-
/* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 gap-x-3 gap-y-0.5 text-[10px] text-white/50", children: [
|
|
120
|
-
snapshot.harmony && /* @__PURE__ */ jsxs("div", { children: [
|
|
121
|
-
/* @__PURE__ */ jsx("span", { className: "text-white/30", children: "Harmony" }),
|
|
122
|
-
" ",
|
|
123
|
-
snapshot.harmony
|
|
124
|
-
] }),
|
|
125
|
-
snapshot.radiusScale && /* @__PURE__ */ jsxs("div", { children: [
|
|
126
|
-
/* @__PURE__ */ jsx("span", { className: "text-white/30", children: "Radius" }),
|
|
127
|
-
" ",
|
|
128
|
-
snapshot.radiusScale
|
|
129
|
-
] }),
|
|
130
|
-
snapshot.shadowIntensity && /* @__PURE__ */ jsxs("div", { children: [
|
|
131
|
-
/* @__PURE__ */ jsx("span", { className: "text-white/30", children: "Shadow" }),
|
|
132
|
-
" ",
|
|
133
|
-
snapshot.shadowIntensity
|
|
134
|
-
] }),
|
|
135
|
-
snapshot.neutralTemperature && /* @__PURE__ */ jsxs("div", { children: [
|
|
136
|
-
/* @__PURE__ */ jsx("span", { className: "text-white/30", children: "Temp" }),
|
|
137
|
-
" ",
|
|
138
|
-
snapshot.neutralTemperature
|
|
139
|
-
] })
|
|
140
|
-
] })
|
|
141
|
-
] }),
|
|
142
|
-
isGenerated && snapshot.lightTokens && /* @__PURE__ */ jsxs("div", { children: [
|
|
143
|
-
/* @__PURE__ */ jsx("div", { className: "mb-1 text-[10px] font-semibold text-violet-400", children: "Light" }),
|
|
144
|
-
/* @__PURE__ */ jsx("div", { className: "flex flex-wrap gap-1", children: SWATCH_TOKENS.map(({ token, label }) => {
|
|
145
|
-
var _a, _b;
|
|
146
|
-
return /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center gap-0.5", children: [
|
|
147
|
-
/* @__PURE__ */ jsx(
|
|
148
|
-
"div",
|
|
149
|
-
{
|
|
150
|
-
className: "h-4 w-4 rounded-sm border border-white/15",
|
|
151
|
-
style: {
|
|
152
|
-
backgroundColor: (_b = (_a = snapshot.lightTokens) == null ? void 0 : _a[token]) != null ? _b : "#888"
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
),
|
|
156
|
-
/* @__PURE__ */ jsx("span", { className: "text-[7px] text-white/30", children: label })
|
|
157
|
-
] }, token);
|
|
158
|
-
}) }),
|
|
159
|
-
snapshot.darkTokens && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
160
|
-
/* @__PURE__ */ jsx("div", { className: "mt-2 mb-1 text-[10px] font-semibold text-violet-400", children: "Dark" }),
|
|
161
|
-
/* @__PURE__ */ jsx("div", { className: "flex flex-wrap gap-1", children: SWATCH_TOKENS.map(({ token, label }) => {
|
|
162
|
-
var _a, _b;
|
|
163
|
-
return /* @__PURE__ */ jsxs(
|
|
164
|
-
"div",
|
|
165
|
-
{
|
|
166
|
-
className: "flex flex-col items-center gap-0.5",
|
|
167
|
-
children: [
|
|
168
|
-
/* @__PURE__ */ jsx(
|
|
169
|
-
"div",
|
|
170
|
-
{
|
|
171
|
-
className: "h-4 w-4 rounded-sm border border-white/15",
|
|
172
|
-
style: {
|
|
173
|
-
backgroundColor: (_b = (_a = snapshot.darkTokens) == null ? void 0 : _a[token]) != null ? _b : "#333"
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
),
|
|
177
|
-
/* @__PURE__ */ jsx("span", { className: "text-[7px] text-white/30", children: label })
|
|
178
|
-
]
|
|
179
|
-
},
|
|
180
|
-
token
|
|
181
|
-
);
|
|
182
|
-
}) })
|
|
183
|
-
] })
|
|
184
|
-
] }),
|
|
185
|
-
isGenerated && snapshot.lightTokens && /* @__PURE__ */ jsxs("div", { children: [
|
|
186
|
-
/* @__PURE__ */ jsx("div", { className: "mb-1 text-[10px] font-semibold text-violet-400", children: "Contrast" }),
|
|
187
|
-
/* @__PURE__ */ jsx("div", { className: "flex flex-col gap-0.5 text-[10px]", children: CONTRAST_CHECK_PAIRS.map(({ fg, bg, label }) => {
|
|
188
|
-
var _a, _b, _c;
|
|
189
|
-
const fgVal = (_a = snapshot.lightTokens) == null ? void 0 : _a[fg];
|
|
190
|
-
const bgVal = (_b = snapshot.lightTokens) == null ? void 0 : _b[bg];
|
|
191
|
-
return /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1.5", children: [
|
|
192
|
-
/* @__PURE__ */ jsxs("div", { className: "flex gap-0.5", children: [
|
|
193
|
-
/* @__PURE__ */ jsx(
|
|
194
|
-
"div",
|
|
195
|
-
{
|
|
196
|
-
className: "h-3 w-3 rounded-sm border border-white/10",
|
|
197
|
-
style: { backgroundColor: fgVal != null ? fgVal : "#888" }
|
|
198
|
-
}
|
|
199
|
-
),
|
|
200
|
-
/* @__PURE__ */ jsx(
|
|
201
|
-
"div",
|
|
202
|
-
{
|
|
203
|
-
className: "h-3 w-3 rounded-sm border border-white/10",
|
|
204
|
-
style: { backgroundColor: bgVal != null ? bgVal : "#fff" }
|
|
205
|
-
}
|
|
206
|
-
)
|
|
207
|
-
] }),
|
|
208
|
-
/* @__PURE__ */ jsx("span", { className: "text-white/50", children: label }),
|
|
209
|
-
(_c = snapshot.contrastPairs) == null ? void 0 : _c.filter((p) => p.fg === fg && p.bg === bg).map((p, i) => /* @__PURE__ */ jsxs(
|
|
210
|
-
"span",
|
|
211
|
-
{
|
|
212
|
-
className: p.level === "Fail" ? "text-red-400" : p.level === "AAA" ? "text-emerald-400" : "text-amber-300",
|
|
213
|
-
children: [
|
|
214
|
-
p.ratio.toFixed(1),
|
|
215
|
-
" ",
|
|
216
|
-
p.level
|
|
217
|
-
]
|
|
218
|
-
},
|
|
219
|
-
i
|
|
220
|
-
))
|
|
221
|
-
] }, label);
|
|
222
|
-
}) })
|
|
223
|
-
] })
|
|
224
|
-
] });
|
|
225
|
-
}
|
|
226
|
-
function useThemeDevtoolBridge({
|
|
227
|
-
id = "theme",
|
|
228
|
-
label = "Theme",
|
|
229
|
-
order = 15
|
|
230
|
-
} = {}) {
|
|
231
|
-
const [snapshot, setSnapshot] = React.useState(
|
|
232
|
-
null
|
|
233
|
-
);
|
|
234
|
-
const inspect = React.useCallback((nextSnapshot) => {
|
|
235
|
-
setSnapshot(nextSnapshot);
|
|
236
|
-
}, []);
|
|
237
|
-
const plugin = React.useMemo(
|
|
238
|
-
() => ({
|
|
239
|
-
id,
|
|
240
|
-
label,
|
|
241
|
-
order,
|
|
242
|
-
renderPanel: () => /* @__PURE__ */ jsx(ThemeDevtoolPanel, { snapshot })
|
|
243
|
-
}),
|
|
244
|
-
[id, label, order, snapshot]
|
|
245
|
-
);
|
|
246
|
-
useOptDevtoolPlugin(plugin);
|
|
247
|
-
return { inspect };
|
|
248
|
-
}
|
|
249
|
-
|
|
250
|
-
export {
|
|
251
|
-
themeConfigToSnapshot,
|
|
252
|
-
useThemeDevtoolBridge
|
|
253
|
-
};
|
package/dist/chunk-YCYIUFB4.js
DELETED
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
// src/i18n/ko.ts
|
|
4
|
-
var koDevtoolLabels = {
|
|
5
|
-
panelTitle: "opt-devtool",
|
|
6
|
-
toggleHint: "Ctrl+Shift+F",
|
|
7
|
-
copyButtonTooltip: "\uB514\uBC84\uADF8 \uC815\uBCF4 \uBCF5\uC0AC",
|
|
8
|
-
closeButton: "\uB2EB\uAE30",
|
|
9
|
-
tabComponent: "\uCEF4\uD3EC\uB10C\uD2B8",
|
|
10
|
-
tabEditor: "opt-editor",
|
|
11
|
-
tabBrandapp: "Brandapp",
|
|
12
|
-
tabTheme: "\uD14C\uB9C8",
|
|
13
|
-
tabHarness: "\uD558\uB124\uC2A4",
|
|
14
|
-
emptyComponent: "\uC544\uBB34 \uC694\uC18C\uB97C \uD3EC\uCEE4\uC2A4\uD558\uBA74\n\uC815\uBCF4\uAC00 \uC5EC\uAE30\uC5D0 \uD45C\uC2DC\uB429\uB2C8\uB2E4.",
|
|
15
|
-
emptyEditor: "\uC774 \uD398\uC774\uC9C0\uC5D0 \uB4F1\uB85D\uB41C Editor snapshot\uC774 \uC5C6\uC2B5\uB2C8\uB2E4",
|
|
16
|
-
emptyBrandapp: "\uC774 \uD398\uC774\uC9C0\uC5D0 \uB4F1\uB85D\uB41C Brandapp SDK snapshot\uC774 \uC5C6\uC2B5\uB2C8\uB2E4",
|
|
17
|
-
emptyEnginePanel: "\uD328\uB110\uC744 \uC120\uD0DD\uD558\uC138\uC694",
|
|
18
|
-
inspectingPinned: "\uC778\uC2A4\uD399\uD2B8 \uB300\uC0C1 (\uACE0\uC815)",
|
|
19
|
-
inspecting: "\uC778\uC2A4\uD399\uD2B8 \uB300\uC0C1",
|
|
20
|
-
currentFocus: "\uD604\uC7AC \uD3EC\uCEE4\uC2A4",
|
|
21
|
-
componentTrace: "\uCEF4\uD3EC\uB10C\uD2B8 \uCD94\uC801",
|
|
22
|
-
componentTree: "\uCEF4\uD3EC\uB10C\uD2B8 \uD2B8\uB9AC",
|
|
23
|
-
noReactComponent: "React \uCEF4\uD3EC\uB10C\uD2B8\uB97C \uCC3E\uC744 \uC218 \uC5C6\uC74C",
|
|
24
|
-
tabOrderInline: "Tab \uC21C\uC11C",
|
|
25
|
-
tabOrderOut: "Tab \uC21C\uC11C (\uC21C\uC11C \uBC16)",
|
|
26
|
-
tabOrderHint: "Tab\uC73C\uB85C \uB3C4\uB2EC\uD560 \uC218 \uC5C6\uC74C (roving tabindex \uB610\uB294 \uD504\uB85C\uADF8\uB798\uBC0D \uD3EC\uCEE4\uC2A4)",
|
|
27
|
-
shiftTabPrev: "Shift+Tab (\uC774\uC804)",
|
|
28
|
-
tabNext: "Tab (\uB2E4\uC74C)",
|
|
29
|
-
arrowKeysTitle: (type, index, total) => `\uBC29\uD5A5\uD0A4 (${type}) ${index}/${total}`,
|
|
30
|
-
loopBadge: "Loop",
|
|
31
|
-
wrapBadge: "Wrap",
|
|
32
|
-
noArrowTarget: "\uBC29\uD5A5\uD0A4 \uB300\uC0C1 \uC5C6\uC74C (\uB05D)",
|
|
33
|
-
spatialNav: "\uACF5\uAC04 \uB124\uBE44\uAC8C\uC774\uC158",
|
|
34
|
-
spatialProtected: "\uBCF4\uD638\uB428",
|
|
35
|
-
spatialNoCandidate: "\uD6C4\uBCF4 \uC5C6\uC74C",
|
|
36
|
-
spatialTrappedContext: (context) => `trapped context (${context})`,
|
|
37
|
-
history: "\uC774\uB3D9 \uAE30\uB85D",
|
|
38
|
-
eventLogTitle: "\uC774\uBCA4\uD2B8 \uB85C\uADF8",
|
|
39
|
-
eventLogClear: "\uC9C0\uC6B0\uAE30",
|
|
40
|
-
eventLogWaiting: "\uC774\uBCA4\uD2B8 \uB300\uAE30 \uC911\u2026",
|
|
41
|
-
overlaysSection: "\uC624\uBC84\uB808\uC774",
|
|
42
|
-
panelsSection: "\uC815\uBCF4 \uD328\uB110",
|
|
43
|
-
toggleGuide: "\uAC00\uC774\uB4DC \uB77C\uC778",
|
|
44
|
-
toggleTabOrder: "Tab \uC21C\uC11C",
|
|
45
|
-
toggleSpatialNav: "\uACF5\uAC04 \uD0D0\uC0C9",
|
|
46
|
-
toggleComponentLabels: "\uCEF4\uD3EC\uB10C\uD2B8 \uB77C\uBCA8",
|
|
47
|
-
toggleCompositeBounds: "Composite \uC601\uC5ED",
|
|
48
|
-
toggleComponentTrace: "\uCEF4\uD3EC\uB10C\uD2B8 \uCD94\uC801",
|
|
49
|
-
toggleComponentTree: "\uCEF4\uD3EC\uB10C\uD2B8 \uD2B8\uB9AC",
|
|
50
|
-
toggleEventLog: "\uC774\uBCA4\uD2B8 \uB85C\uADF8",
|
|
51
|
-
toggleInspect: "\uC778\uC2A4\uD399\uD2B8",
|
|
52
|
-
trapped: "trapped",
|
|
53
|
-
protected: "\uBCF4\uD638",
|
|
54
|
-
filterUser: "\uC0AC\uC6A9\uC790",
|
|
55
|
-
filterPrimitives: "Primitives",
|
|
56
|
-
filterAll: "\uC804\uCCB4"
|
|
57
|
-
};
|
|
58
|
-
|
|
59
|
-
// src/types.ts
|
|
60
|
-
var OPT_DEVTOOL_CONFIGURE_EVENT = "opt-devtool-configure";
|
|
61
|
-
|
|
62
|
-
export {
|
|
63
|
-
koDevtoolLabels,
|
|
64
|
-
OPT_DEVTOOL_CONFIGURE_EVENT
|
|
65
|
-
};
|
package/dist/chunk-Z2KFRHSI.js
DELETED
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import {
|
|
3
|
-
__spreadProps,
|
|
4
|
-
__spreadValues
|
|
5
|
-
} from "./chunk-UJSIQF3A.js";
|
|
6
|
-
|
|
7
|
-
// src/provider.tsx
|
|
8
|
-
import * as React from "react";
|
|
9
|
-
import { jsx } from "react/jsx-runtime";
|
|
10
|
-
var EMPTY_REGISTRY = {
|
|
11
|
-
plugins: [],
|
|
12
|
-
registerPlugin: () => () => void 0
|
|
13
|
-
};
|
|
14
|
-
var OptDevtoolRegistryContext = React.createContext(EMPTY_REGISTRY);
|
|
15
|
-
function sortPlugins(plugins) {
|
|
16
|
-
return [...plugins].sort((left, right) => {
|
|
17
|
-
var _a, _b;
|
|
18
|
-
const orderDelta = ((_a = left.order) != null ? _a : 0) - ((_b = right.order) != null ? _b : 0);
|
|
19
|
-
if (orderDelta !== 0) {
|
|
20
|
-
return orderDelta;
|
|
21
|
-
}
|
|
22
|
-
const labelDelta = left.label.localeCompare(right.label);
|
|
23
|
-
if (labelDelta !== 0) {
|
|
24
|
-
return labelDelta;
|
|
25
|
-
}
|
|
26
|
-
return left.id.localeCompare(right.id);
|
|
27
|
-
});
|
|
28
|
-
}
|
|
29
|
-
function OptDevtoolProvider({
|
|
30
|
-
children
|
|
31
|
-
}) {
|
|
32
|
-
const [plugins, setPlugins] = React.useState(
|
|
33
|
-
[]
|
|
34
|
-
);
|
|
35
|
-
const registerPlugin = React.useCallback((registrationKey, plugin) => {
|
|
36
|
-
setPlugins(
|
|
37
|
-
(current) => sortPlugins([
|
|
38
|
-
...current.filter((item) => item.registrationKey !== registrationKey),
|
|
39
|
-
__spreadProps(__spreadValues({}, plugin), {
|
|
40
|
-
registrationKey
|
|
41
|
-
})
|
|
42
|
-
])
|
|
43
|
-
);
|
|
44
|
-
return () => {
|
|
45
|
-
setPlugins(
|
|
46
|
-
(current) => current.filter((item) => item.registrationKey !== registrationKey)
|
|
47
|
-
);
|
|
48
|
-
};
|
|
49
|
-
}, []);
|
|
50
|
-
const value = React.useMemo(
|
|
51
|
-
() => ({
|
|
52
|
-
plugins,
|
|
53
|
-
registerPlugin
|
|
54
|
-
}),
|
|
55
|
-
[plugins, registerPlugin]
|
|
56
|
-
);
|
|
57
|
-
return /* @__PURE__ */ jsx(OptDevtoolRegistryContext.Provider, { value, children });
|
|
58
|
-
}
|
|
59
|
-
function useOptDevtoolRegistry() {
|
|
60
|
-
return React.useContext(OptDevtoolRegistryContext);
|
|
61
|
-
}
|
|
62
|
-
function useOptDevtoolPlugin(plugin) {
|
|
63
|
-
const { registerPlugin } = useOptDevtoolRegistry();
|
|
64
|
-
const registrationKey = React.useId();
|
|
65
|
-
React.useEffect(() => {
|
|
66
|
-
if (!plugin) {
|
|
67
|
-
return void 0;
|
|
68
|
-
}
|
|
69
|
-
return registerPlugin(registrationKey, plugin);
|
|
70
|
-
}, [plugin, registerPlugin, registrationKey]);
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
export {
|
|
74
|
-
OptDevtoolProvider,
|
|
75
|
-
useOptDevtoolRegistry,
|
|
76
|
-
useOptDevtoolPlugin
|
|
77
|
-
};
|
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
|
|
3
|
-
declare const OPT_DEVTOOL_CONFIGURE_EVENT = "opt-devtool-configure";
|
|
4
|
-
/** Built-in overlay tab slots that inspect plugins can target. */
|
|
5
|
-
type OptDevtoolPluginTab = "component" | "editor" | "brandapp";
|
|
6
|
-
/** Runtime configuration payload for toggling opt-devtool state. */
|
|
7
|
-
interface OptDevtoolConfig {
|
|
8
|
-
visible?: boolean;
|
|
9
|
-
showGuide?: boolean;
|
|
10
|
-
showTabOrder?: boolean;
|
|
11
|
-
showSpatialNav?: boolean;
|
|
12
|
-
showEventLog?: boolean;
|
|
13
|
-
showComponentTrace?: boolean;
|
|
14
|
-
showComponentTree?: boolean;
|
|
15
|
-
showInspect?: boolean;
|
|
16
|
-
showComponentLabels?: boolean;
|
|
17
|
-
showCompositeBounds?: boolean;
|
|
18
|
-
}
|
|
19
|
-
/** Page-local module plugin registered into the opt-devtool overlay. */
|
|
20
|
-
interface OptDevtoolPlugin {
|
|
21
|
-
id: string;
|
|
22
|
-
label: string;
|
|
23
|
-
order?: number;
|
|
24
|
-
tab?: OptDevtoolPluginTab;
|
|
25
|
-
renderPanel: () => React.ReactNode;
|
|
26
|
-
renderOverlay?: () => React.ReactNode;
|
|
27
|
-
}
|
|
28
|
-
/** Localised strings rendered inside the devtool overlay. */
|
|
29
|
-
interface OptDevtoolLabels {
|
|
30
|
-
panelTitle: string;
|
|
31
|
-
toggleHint: string;
|
|
32
|
-
copyButtonTooltip: string;
|
|
33
|
-
closeButton: string;
|
|
34
|
-
tabComponent: string;
|
|
35
|
-
tabEditor: string;
|
|
36
|
-
tabBrandapp: string;
|
|
37
|
-
tabTheme: string;
|
|
38
|
-
tabHarness: string;
|
|
39
|
-
emptyComponent: string;
|
|
40
|
-
emptyEditor: string;
|
|
41
|
-
emptyBrandapp: string;
|
|
42
|
-
emptyEnginePanel: string;
|
|
43
|
-
inspectingPinned: string;
|
|
44
|
-
inspecting: string;
|
|
45
|
-
currentFocus: string;
|
|
46
|
-
componentTrace: string;
|
|
47
|
-
componentTree: string;
|
|
48
|
-
noReactComponent: string;
|
|
49
|
-
tabOrderInline: string;
|
|
50
|
-
tabOrderOut: string;
|
|
51
|
-
tabOrderHint: string;
|
|
52
|
-
shiftTabPrev: string;
|
|
53
|
-
tabNext: string;
|
|
54
|
-
arrowKeysTitle: (type: string, index: number, total: number) => string;
|
|
55
|
-
loopBadge: string;
|
|
56
|
-
wrapBadge: string;
|
|
57
|
-
noArrowTarget: string;
|
|
58
|
-
spatialNav: string;
|
|
59
|
-
spatialProtected: string;
|
|
60
|
-
spatialNoCandidate: string;
|
|
61
|
-
spatialTrappedContext: (context: string) => string;
|
|
62
|
-
history: string;
|
|
63
|
-
eventLogTitle: string;
|
|
64
|
-
eventLogClear: string;
|
|
65
|
-
eventLogWaiting: string;
|
|
66
|
-
overlaysSection: string;
|
|
67
|
-
panelsSection: string;
|
|
68
|
-
toggleGuide: string;
|
|
69
|
-
toggleTabOrder: string;
|
|
70
|
-
toggleSpatialNav: string;
|
|
71
|
-
toggleComponentLabels: string;
|
|
72
|
-
toggleCompositeBounds: string;
|
|
73
|
-
toggleComponentTrace: string;
|
|
74
|
-
toggleComponentTree: string;
|
|
75
|
-
toggleEventLog: string;
|
|
76
|
-
toggleInspect: string;
|
|
77
|
-
trapped: string;
|
|
78
|
-
protected: string;
|
|
79
|
-
filterUser: string;
|
|
80
|
-
filterPrimitives: string;
|
|
81
|
-
filterAll: string;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
/** Root overlay props. */
|
|
85
|
-
interface OptDevtoolProps {
|
|
86
|
-
defaultOpen?: boolean;
|
|
87
|
-
/** Override individual labels. Falls back to {@link defaultLabels} (Korean). */
|
|
88
|
-
labels?: Partial<OptDevtoolLabels>;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
export { type OptDevtoolLabels as O, type OptDevtoolPlugin as a, type OptDevtoolProps as b, OPT_DEVTOOL_CONFIGURE_EVENT as c, type OptDevtoolConfig as d, type OptDevtoolPluginTab as e };
|
package/dist/index-Bakx4o8Z.d.ts
DELETED
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
|
|
3
|
-
declare const OPT_DEVTOOL_CONFIGURE_EVENT = "opt-devtool-configure";
|
|
4
|
-
/** Built-in overlay tab slots that inspect plugins can target. */
|
|
5
|
-
type OptDevtoolPluginTab = "component" | "editor" | "brandapp";
|
|
6
|
-
/** Runtime configuration payload for toggling opt-devtool state. */
|
|
7
|
-
interface OptDevtoolConfig {
|
|
8
|
-
visible?: boolean;
|
|
9
|
-
showGuide?: boolean;
|
|
10
|
-
showTabOrder?: boolean;
|
|
11
|
-
showSpatialNav?: boolean;
|
|
12
|
-
showEventLog?: boolean;
|
|
13
|
-
showComponentTrace?: boolean;
|
|
14
|
-
showComponentTree?: boolean;
|
|
15
|
-
showInspect?: boolean;
|
|
16
|
-
showComponentLabels?: boolean;
|
|
17
|
-
showCompositeBounds?: boolean;
|
|
18
|
-
}
|
|
19
|
-
/** Page-local module plugin registered into the opt-devtool overlay. */
|
|
20
|
-
interface OptDevtoolPlugin {
|
|
21
|
-
id: string;
|
|
22
|
-
label: string;
|
|
23
|
-
order?: number;
|
|
24
|
-
tab?: OptDevtoolPluginTab;
|
|
25
|
-
renderPanel: () => React.ReactNode;
|
|
26
|
-
renderOverlay?: () => React.ReactNode;
|
|
27
|
-
}
|
|
28
|
-
/** Localised strings rendered inside the devtool overlay. */
|
|
29
|
-
interface OptDevtoolLabels {
|
|
30
|
-
panelTitle: string;
|
|
31
|
-
toggleHint: string;
|
|
32
|
-
copyButtonTooltip: string;
|
|
33
|
-
closeButton: string;
|
|
34
|
-
tabComponent: string;
|
|
35
|
-
tabEditor: string;
|
|
36
|
-
tabBrandapp: string;
|
|
37
|
-
tabTheme: string;
|
|
38
|
-
tabHarness: string;
|
|
39
|
-
emptyComponent: string;
|
|
40
|
-
emptyEditor: string;
|
|
41
|
-
emptyBrandapp: string;
|
|
42
|
-
emptyEnginePanel: string;
|
|
43
|
-
inspectingPinned: string;
|
|
44
|
-
inspecting: string;
|
|
45
|
-
currentFocus: string;
|
|
46
|
-
componentTrace: string;
|
|
47
|
-
componentTree: string;
|
|
48
|
-
noReactComponent: string;
|
|
49
|
-
tabOrderInline: string;
|
|
50
|
-
tabOrderOut: string;
|
|
51
|
-
tabOrderHint: string;
|
|
52
|
-
shiftTabPrev: string;
|
|
53
|
-
tabNext: string;
|
|
54
|
-
arrowKeysTitle: (type: string, index: number, total: number) => string;
|
|
55
|
-
loopBadge: string;
|
|
56
|
-
wrapBadge: string;
|
|
57
|
-
noArrowTarget: string;
|
|
58
|
-
spatialNav: string;
|
|
59
|
-
spatialProtected: string;
|
|
60
|
-
spatialNoCandidate: string;
|
|
61
|
-
spatialTrappedContext: (context: string) => string;
|
|
62
|
-
history: string;
|
|
63
|
-
eventLogTitle: string;
|
|
64
|
-
eventLogClear: string;
|
|
65
|
-
eventLogWaiting: string;
|
|
66
|
-
overlaysSection: string;
|
|
67
|
-
panelsSection: string;
|
|
68
|
-
toggleGuide: string;
|
|
69
|
-
toggleTabOrder: string;
|
|
70
|
-
toggleSpatialNav: string;
|
|
71
|
-
toggleComponentLabels: string;
|
|
72
|
-
toggleCompositeBounds: string;
|
|
73
|
-
toggleComponentTrace: string;
|
|
74
|
-
toggleComponentTree: string;
|
|
75
|
-
toggleEventLog: string;
|
|
76
|
-
toggleInspect: string;
|
|
77
|
-
trapped: string;
|
|
78
|
-
protected: string;
|
|
79
|
-
filterUser: string;
|
|
80
|
-
filterPrimitives: string;
|
|
81
|
-
filterAll: string;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
/** Root overlay props. */
|
|
85
|
-
interface OptDevtoolProps {
|
|
86
|
-
defaultOpen?: boolean;
|
|
87
|
-
/** Override individual labels. Falls back to {@link defaultLabels} (Korean). */
|
|
88
|
-
labels?: Partial<OptDevtoolLabels>;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
export { type OptDevtoolLabels as O, type OptDevtoolPlugin as a, type OptDevtoolProps as b, OPT_DEVTOOL_CONFIGURE_EVENT as c, type OptDevtoolConfig as d, type OptDevtoolPluginTab as e };
|