@plitzi/sdk-variables 0.38.16 → 0.38.18
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 +113 -0
- package/dist/VariablesContext.mjs +1 -1
- package/dist/{components → builder/components}/SchemaVariables/SchemaVariable.mjs +1 -1
- package/dist/{components → builder/components}/SchemaVariables/SchemaVariables.mjs +1 -1
- package/dist/{components → builder/components}/SchemaVariables/VariableDetails.mjs +22 -22
- package/dist/{components → builder/components}/SchemaVariables/VariableValue.mjs +1 -1
- package/dist/{components → builder/components}/SchemaVariables/index.mjs +1 -1
- package/dist/{components → builder/components}/StyleVariables/StyleVariable.mjs +1 -1
- package/dist/{components → builder/components}/StyleVariables/StyleVariables.mjs +1 -1
- package/dist/builder/components/StyleVariables/VariableDetails.mjs +31 -0
- package/dist/{components → builder/components}/StyleVariables/VariableGroup.mjs +1 -1
- package/dist/{components → builder/components}/StyleVariables/VariableList.mjs +1 -1
- package/dist/{components → builder/components}/StyleVariables/VariableValue.mjs +1 -1
- package/dist/{components → builder/components}/StyleVariables/index.mjs +1 -1
- package/dist/{components → builder/components}/VariableActions/VariableActions.mjs +1 -1
- package/dist/{components → builder/components}/VariableActions/index.mjs +1 -1
- package/dist/{components → builder/components}/index.mjs +2 -2
- package/dist/builder/index.d.ts +9 -0
- package/dist/builder/index.mjs +9 -0
- package/dist/{models → builder/models}/SchemaVariableForm/SchemaVariableForm.mjs +1 -1
- package/dist/{models → builder/models}/SchemaVariableForm/VariableSubValue.mjs +17 -17
- package/dist/{models → builder/models}/SchemaVariableForm/VariableSubValueActions.mjs +1 -1
- package/dist/{models → builder/models}/SchemaVariableForm/VariableValue.mjs +1 -1
- package/dist/{models → builder/models}/SchemaVariableForm/index.mjs +1 -1
- package/dist/{models → builder/models}/StyleVariableForm/StyleVariableForm.mjs +1 -1
- package/dist/{models → builder/models}/StyleVariableForm/index.mjs +1 -1
- package/dist/{models → builder/models}/index.mjs +2 -2
- package/dist/index.d.ts +1 -5
- package/dist/index.mjs +1 -9
- package/package.json +13 -139
- package/dist/components/StyleVariables/VariableDetails.mjs +0 -31
- /package/dist/{components → builder/components}/SchemaVariables/SchemaVariable.d.ts +0 -0
- /package/dist/{components → builder/components}/SchemaVariables/SchemaVariables.d.ts +0 -0
- /package/dist/{components → builder/components}/SchemaVariables/VariableDetails.d.ts +0 -0
- /package/dist/{components → builder/components}/SchemaVariables/VariableValue.d.ts +0 -0
- /package/dist/{components → builder/components}/SchemaVariables/index.d.ts +0 -0
- /package/dist/{components → builder/components}/StyleVariables/StyleVariable.d.ts +0 -0
- /package/dist/{components → builder/components}/StyleVariables/StyleVariables.d.ts +0 -0
- /package/dist/{components → builder/components}/StyleVariables/VariableDetails.d.ts +0 -0
- /package/dist/{components → builder/components}/StyleVariables/VariableGroup.d.ts +0 -0
- /package/dist/{components → builder/components}/StyleVariables/VariableList.d.ts +0 -0
- /package/dist/{components → builder/components}/StyleVariables/VariableValue.d.ts +0 -0
- /package/dist/{components → builder/components}/StyleVariables/index.d.ts +0 -0
- /package/dist/{components → builder/components}/VariableActions/VariableActions.d.ts +0 -0
- /package/dist/{components → builder/components}/VariableActions/index.d.ts +0 -0
- /package/dist/{components → builder/components}/index.d.ts +0 -0
- /package/dist/{models → builder/models}/SchemaVariableForm/SchemaVariableForm.d.ts +0 -0
- /package/dist/{models → builder/models}/SchemaVariableForm/VariableSubValue.d.ts +0 -0
- /package/dist/{models → builder/models}/SchemaVariableForm/VariableSubValueActions.d.ts +0 -0
- /package/dist/{models → builder/models}/SchemaVariableForm/VariableValue.d.ts +0 -0
- /package/dist/{models → builder/models}/SchemaVariableForm/index.d.ts +0 -0
- /package/dist/{models → builder/models}/StyleVariableForm/StyleVariableForm.d.ts +0 -0
- /package/dist/{models → builder/models}/StyleVariableForm/index.d.ts +0 -0
- /package/dist/{models → builder/models}/index.d.ts +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,118 @@
|
|
|
1
1
|
# @plitzi/sdk-variables
|
|
2
2
|
|
|
3
|
+
## 0.38.18
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- b3023c9: ## Security
|
|
8
|
+
|
|
9
|
+
- **A page of the same site on another origin is no longer this server's own** (`@plitzi/sdk-server`): the guard
|
|
10
|
+
against writes another page caused (`crossSiteWrites`, the sign-in's login-CSRF check and `createOriginGuardMiddleware`)
|
|
11
|
+
trusted `Sec-Fetch-Site: same-site` — and a site has no port and spans every sub-domain, so another port of the host
|
|
12
|
+
(where `createAuthoringHost` serves pages an agent wrote) or a sibling sub-domain (every space of a platform on one
|
|
13
|
+
domain) could write as if it were the server's own page. Now only `same-origin` (and `none`, a typed URL) is; `same-site`
|
|
14
|
+
is refused 403 `reason: 'foreign'` unless its origin is named (`crossSiteWrites.origins`, `identity.platformOrigins`),
|
|
15
|
+
and the `Origin` fallback compares host and port. In production an app and its spaces are already on different sites,
|
|
16
|
+
so a deployment that works there needs nothing; one that relied on a sibling sub-domain locally names it.
|
|
17
|
+
`createAuthoringHost`'s docs now say to serve on a host of its own — a cookie belongs to a host whatever its port.
|
|
18
|
+
|
|
19
|
+
## Server
|
|
20
|
+
- **An open page takes a new version of its space where it stands** (`@plitzi/sdk-server`, `@plitzi/plitzi-sdk`):
|
|
21
|
+
`server.updatePages(documents, { draft? })` hands the pages showing that space — or that draft — its new documents,
|
|
22
|
+
and each swaps them in place, its state, scroll and focus kept (`replaceSpace` on what the SDK's `render` returns;
|
|
23
|
+
`false`, and the page loads again, for a page with elements the server draws). The development loop of a project uses
|
|
24
|
+
it: a save to the space no longer reloads the open page. `createAuthoringHost`'s `put` over an id that pages show
|
|
25
|
+
hands them the new version and answers how many took it (`updated`), so a page an agent keeps improving is seen to
|
|
26
|
+
grow instead of reloading — no second iframe needed.
|
|
27
|
+
- **`devReload` is `livePages`** (`@plitzi/sdk-server`): the channel the open pages listen on now carries the space,
|
|
28
|
+
not only "load again", and a host that is not developing uses it too. Its address is `/__plitzi/live`; a draft's page
|
|
29
|
+
listens for its own changes alone (`?__pt=`). A plugin swapped where it is drawn stays a development server's
|
|
30
|
+
(`devMode`). `plitzi upgrade migrations --write` renames the option in a project's code (`livePagesOption`).
|
|
31
|
+
|
|
32
|
+
## Packages
|
|
33
|
+
- **`@plitzi/sdk-server` starts in half the time** (`@plitzi/sdk-shared`, `@plitzi/sdk-server`): importing it took
|
|
34
|
+
~310 ms, ~200 of them `date-fns` — 108 modules nothing on the server uses, brought by `@plitzi/sdk-shared/helpers` —
|
|
35
|
+
and loaded the browser's hooks and contexts of every folder of `@plitzi/sdk-shared` it read, `@plitzi/nexus/react`
|
|
36
|
+
with them. Now ~150 ms (`@plitzi/sdk-shared` 139 → 113 modules, `@plitzi/nexus` 53 → 31). What moved, each
|
|
37
|
+
rewritten by `plitzi upgrade migrations --write` (`movedExports`):
|
|
38
|
+
- the dates — `formatDate`, `formatDateUTC`, `formatFromNow`, `formatUTCToLocal`, `getDurationMs`, `isDate`,
|
|
39
|
+
`isValidFormat`, `parseDate`, `toUnixSeconds`, `SupportedLocale` — from `@plitzi/sdk-shared/helpers` to
|
|
40
|
+
`@plitzi/sdk-shared/dates`;
|
|
41
|
+
- React's bindings to an entry of their own beside each area, as `@plitzi/nexus/react` is: `useDisplayMode`,
|
|
42
|
+
`useElementSize` → `@plitzi/sdk-shared/style/react`; `SchemaContext` → `schema/react`; `PluginsContext` →
|
|
43
|
+
`plugins/react`; `DevToolsContext` → `devTools/react`; `useFlagResolution` → `flags/react` (`flagUserFrom` stays
|
|
44
|
+
in `flags`);
|
|
45
|
+
- `PROJECT_DATA_PREFIX` from `@plitzi/sdk-shared/server` to `@plitzi/sdk-shared/project/paths` — the project's
|
|
46
|
+
layout names, an entry a browser imports too (`@plitzi/sdk-shared/project` stays Node only and re-exports them).
|
|
47
|
+
The theme cookie's helpers (`themeFromCookies`…) are also `@plitzi/sdk-shared/theme/cookie`, still exported by
|
|
48
|
+
`@plitzi/sdk-shared/theme`.
|
|
49
|
+
|
|
50
|
+
`yarn check:server-footprint` (in CI after the build) holds what the server's root loads, package by package — Plitzi's
|
|
51
|
+
and every other — to a budget: a heavy library or a folder of hooks coming back fails with what came in.
|
|
52
|
+
|
|
53
|
+
## CLI
|
|
54
|
+
- **`plitzi upgrade migrations --write` writes a file import's new home when it has one** (`@plitzi/cli`): the
|
|
55
|
+
`folderImports` migration of 0.38.17 named every import of a package's FILE and wrote none. It now reads the installed
|
|
56
|
+
declarations with the project's own TypeScript and rewrites each `import` / `export … from` whose every name the folder
|
|
57
|
+
exports under one name — `import usePlitzi from '@plitzi/sdk-shared/hooks/usePlitzi'` →
|
|
58
|
+
`import { usePlitzi } from '@plitzi/sdk-shared/hooks'`, `type` modifiers and aliases kept. What has no one answer is
|
|
59
|
+
said with why (a namespace import, an `import()` or mock, a name the folder does not export, a project with no
|
|
60
|
+
TypeScript). The report says which places `--write` writes (`writable` in `--json`) instead of calling every one
|
|
61
|
+
"yours to change"; a migration now gives each place its own `edit` in place of a whole-file `rewrite`
|
|
62
|
+
(`docs/en/releases.md`).
|
|
63
|
+
- **`plitzi doctor` says an import of a path the installed package does not export** (`@plitzi/cli`):
|
|
64
|
+
`import-not-exported`, an error, at the importing file — what Node otherwise reports at start as an
|
|
65
|
+
`ERR_MODULE_NOT_FOUND` into the package's `dist`, which reads as a broken install rather than a changed API. For a
|
|
66
|
+
`@plitzi` package the fix names `plitzi upgrade migrations --write`; for any other, its `exports`. Asked only of a
|
|
67
|
+
package that is installed.
|
|
68
|
+
|
|
69
|
+
- Updated dependencies [b3023c9]
|
|
70
|
+
- @plitzi/sdk-shared@0.38.18
|
|
71
|
+
|
|
72
|
+
## 0.38.17
|
|
73
|
+
|
|
74
|
+
### Patch Changes
|
|
75
|
+
|
|
76
|
+
- 4f8dc37: ## Packages
|
|
77
|
+
|
|
78
|
+
- **A library package is imported by its root and its folders, never by a file** (`@plitzi/sdk-shared`, `sdk-schema`,
|
|
79
|
+
`sdk-style`, `sdk-elements`, `sdk-interactions`, `sdk-auth`, `sdk-dev-tools`, `sdk-event-bridge`, `sdk-navigation`,
|
|
80
|
+
`sdk-plugins`, `sdk-variables`): each `exports` is now `"."` and `"./*"`, the latter a folder's `index`.
|
|
81
|
+
`@plitzi/sdk-shared/helpers/isRecord` becomes `import { isRecord } from '@plitzi/sdk-shared/helpers'`, and a default
|
|
82
|
+
export by the name its folder gives it — almost always its file's (`import usePlitzi from '…/hooks/usePlitzi'` →
|
|
83
|
+
`import { usePlitzi } from '@plitzi/sdk-shared/hooks'`). A file-level specifier now fails with `ERR_MODULE_NOT_FOUND`.
|
|
84
|
+
New entries where a folder barrel would have brought more than was asked for: `@plitzi/sdk-shared/project` and
|
|
85
|
+
`@plitzi/sdk-shared/plugins/bundle` (Node only), `@plitzi/sdk-interactions/declarations` (the global callbacks and
|
|
86
|
+
utility specs, without React), and `@plitzi/sdk-elements/elements/declarations`, which now also carries the
|
|
87
|
+
declarations' attribute types and the constants they are checked with. `RuleGroup` is exported by `@plitzi/sdk-shared`
|
|
88
|
+
with the document types that use it. `plitzi upgrade migrations` names every such import in a project, with the folder to
|
|
89
|
+
import it from instead.
|
|
90
|
+
- **`@plitzi/sdk-shared`'s root exports the document types, and only them** (`@plitzi/sdk-shared`): what the package
|
|
91
|
+
does is imported from its folder — `formatDate` from `@plitzi/sdk-shared/helpers`, `ThemeProvider` from
|
|
92
|
+
`@plitzi/sdk-shared/theme`, a GraphQL operation's types from `@plitzi/sdk-shared/network/graphql` — so a module that
|
|
93
|
+
imports a type from the root no longer loads every area of the package.
|
|
94
|
+
- **What one package alone used lives in that package** (`@plitzi/sdk-shared`, `@plitzi/sdk-elements`): the data
|
|
95
|
+
source hooks moved from `@plitzi/sdk-shared/dataSource/hooks` to `@plitzi/sdk-elements/dataSource`
|
|
96
|
+
(`useRegisterSource`, `useResolvedVariables`), and the Apollo links the builder's client is built with into the
|
|
97
|
+
builder.
|
|
98
|
+
- **The builder's panels are an entry of their own** (`@plitzi/sdk-style`, `@plitzi/sdk-variables`,
|
|
99
|
+
`@plitzi/sdk-elements`): the style inspector, the advanced style editor and `BuilderStyleContextProvider` are imported
|
|
100
|
+
from `@plitzi/sdk-style/builder`; the variables' lists and forms from `@plitzi/sdk-variables/builder`; the elements'
|
|
101
|
+
settings panels (`defaultElementsSettings`) from `@plitzi/sdk-elements/builder`. Each package's root keeps what a page
|
|
102
|
+
and a server use — `generateCache` no longer loads the inspector, on a server 227 modules down to 21.
|
|
103
|
+
|
|
104
|
+
## CLI
|
|
105
|
+
- **`plitzi upgrade`'s `renames` part is now `migrations`** (`@plitzi/cli`): what a version changed that a project's
|
|
106
|
+
own source must follow, one file per change in the CLI's `src/migrations/changes/` with the version it shipped in —
|
|
107
|
+
rewritten with `--write` when it has one right answer, said otherwise. The `--json` report carries `migrations` (each
|
|
108
|
+
with its `migration`, `since`, `file`, `line`, `what` and whether it was `written`) in place of `renames` and
|
|
109
|
+
`changes`. The changes of 0.38.0 (`canTemplate` → `canSnippet`, the `*Template` authoring names), 0.38.9 (a
|
|
110
|
+
`formControl` without `required` is optional) and 0.38.12 (`usePlitziServiceContext` → `usePlitzi`) are no longer
|
|
111
|
+
looked for: a project still on one of those versions makes them by hand.
|
|
112
|
+
|
|
113
|
+
- Updated dependencies [4f8dc37]
|
|
114
|
+
- @plitzi/sdk-shared@0.38.17
|
|
115
|
+
|
|
3
116
|
## 0.38.16
|
|
4
117
|
|
|
5
118
|
### Patch Changes
|
|
@@ -5,7 +5,7 @@ import r from "../../models/SchemaVariableForm/index.mjs";
|
|
|
5
5
|
import { omit as i } from "@plitzi/plitzi-ui/helpers";
|
|
6
6
|
import { useCallback as a, useState as o } from "react";
|
|
7
7
|
import { jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
8
|
-
//#region src/components/SchemaVariables/SchemaVariable.tsx
|
|
8
|
+
//#region src/builder/components/SchemaVariables/SchemaVariable.tsx
|
|
9
9
|
var l = ({ name: l = "variable", value: u = "", type: d = "text", category: f = "", subValues: p, whenData: m, onChange: h, onRemove: g }) => {
|
|
10
10
|
let [_, v] = o(!1), [y, b] = o(!1), x = a((e) => {
|
|
11
11
|
e.stopPropagation(), g(l);
|
|
@@ -4,7 +4,7 @@ import { useCallback as n, useState as r } from "react";
|
|
|
4
4
|
import i from "@plitzi/plitzi-ui/Button";
|
|
5
5
|
import a from "clsx";
|
|
6
6
|
import { jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
7
|
-
//#region src/components/SchemaVariables/SchemaVariables.tsx
|
|
7
|
+
//#region src/builder/components/SchemaVariables/SchemaVariables.tsx
|
|
8
8
|
var c = ({ className: c, variables: l, whenData: u, onAdd: d, onUpdate: f, onRemove: p }) => {
|
|
9
9
|
let [m, h] = r(), g = n((e) => {
|
|
10
10
|
d?.(e), h(void 0);
|
|
@@ -1,52 +1,52 @@
|
|
|
1
1
|
import e from "./VariableValue.mjs";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
//#region src/components/SchemaVariables/VariableDetails.tsx
|
|
2
|
+
import { NOT_COPIED_REASON as t, copyText as n } from "@plitzi/sdk-shared/helpers";
|
|
3
|
+
import { useCallback as r } from "react";
|
|
4
|
+
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
5
|
+
import { QueryBuilderFormatter as o } from "@plitzi/plitzi-ui/QueryBuilder";
|
|
6
|
+
import { useToast as s } from "@plitzi/plitzi-ui/Toast";
|
|
7
|
+
//#region src/builder/components/SchemaVariables/VariableDetails.tsx
|
|
8
8
|
var c = ({ name: c, subValues: l = [], type: u = "text" }) => {
|
|
9
|
-
let { addToast: d } =
|
|
10
|
-
|
|
9
|
+
let { addToast: d } = s(), f = r(() => {
|
|
10
|
+
n(`{{${c}}}`).then((e) => d(e ? "Variable copied into the clipboard" : t, {
|
|
11
11
|
appeareance: e ? "success" : "error",
|
|
12
12
|
autoDismiss: !0,
|
|
13
13
|
placement: "top-right"
|
|
14
14
|
}));
|
|
15
15
|
}, [d, c]);
|
|
16
|
-
return /* @__PURE__ */
|
|
16
|
+
return /* @__PURE__ */ a("div", {
|
|
17
17
|
className: "flex w-full flex-col gap-2",
|
|
18
|
-
children: [l.length > 0 && /* @__PURE__ */
|
|
18
|
+
children: [l.length > 0 && /* @__PURE__ */ i("div", {
|
|
19
19
|
className: "flex w-full flex-col gap-1",
|
|
20
|
-
children: l.map((t,
|
|
20
|
+
children: l.map((t, n) => /* @__PURE__ */ a("div", {
|
|
21
21
|
className: "flex w-full flex-col rounded-sm border border-gray-300 text-xs",
|
|
22
|
-
children: [/* @__PURE__ */
|
|
22
|
+
children: [/* @__PURE__ */ a("div", {
|
|
23
23
|
className: "flex items-center gap-1 px-1 py-0.5",
|
|
24
|
-
children: [/* @__PURE__ */
|
|
24
|
+
children: [/* @__PURE__ */ i("div", {
|
|
25
25
|
className: "font-bold",
|
|
26
26
|
children: "Value:"
|
|
27
|
-
}), /* @__PURE__ */
|
|
27
|
+
}), /* @__PURE__ */ i(e, {
|
|
28
28
|
className: "text-xs",
|
|
29
29
|
value: String(t.value),
|
|
30
30
|
type: u
|
|
31
31
|
})]
|
|
32
|
-
}), /* @__PURE__ */
|
|
32
|
+
}), /* @__PURE__ */ a("div", {
|
|
33
33
|
className: "flex gap-1 border-t border-gray-300 px-1 py-0.5",
|
|
34
|
-
children: [/* @__PURE__ */
|
|
34
|
+
children: [/* @__PURE__ */ i("div", {
|
|
35
35
|
className: "font-bold",
|
|
36
36
|
children: "When:"
|
|
37
|
-
}),
|
|
37
|
+
}), o(t.when)]
|
|
38
38
|
})]
|
|
39
|
-
},
|
|
40
|
-
}), /* @__PURE__ */
|
|
39
|
+
}, n))
|
|
40
|
+
}), /* @__PURE__ */ a("div", {
|
|
41
41
|
className: "flex items-center justify-between gap-2",
|
|
42
|
-
children: [/* @__PURE__ */
|
|
42
|
+
children: [/* @__PURE__ */ a("div", {
|
|
43
43
|
className: "flex gap-1",
|
|
44
|
-
children: ["Token:", /* @__PURE__ */
|
|
44
|
+
children: ["Token:", /* @__PURE__ */ i("div", {
|
|
45
45
|
className: "truncate font-bold",
|
|
46
46
|
title: c,
|
|
47
47
|
children: `{{${c}}}`
|
|
48
48
|
})]
|
|
49
|
-
}), /* @__PURE__ */
|
|
49
|
+
}), /* @__PURE__ */ i("i", {
|
|
50
50
|
className: "fa-solid fa-copy cursor-pointer hover:text-blue-400",
|
|
51
51
|
onClick: f,
|
|
52
52
|
title: "Copy"
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as e, jsxs as t } from "react/jsx-runtime";
|
|
2
|
-
//#region src/components/SchemaVariables/VariableValue.tsx
|
|
2
|
+
//#region src/builder/components/SchemaVariables/VariableValue.tsx
|
|
3
3
|
var n = ({ type: n, value: r }) => /* @__PURE__ */ t("div", {
|
|
4
4
|
className: "flex items-center gap-1 truncate text-xs",
|
|
5
5
|
children: [n === "color" && /* @__PURE__ */ e("div", {
|
|
@@ -6,7 +6,7 @@ import { omit as i } from "@plitzi/plitzi-ui/helpers";
|
|
|
6
6
|
import { useCallback as a, useState as o } from "react";
|
|
7
7
|
import { jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
8
8
|
import { StyleVariableCategory as l } from "@plitzi/sdk-shared";
|
|
9
|
-
//#region src/components/StyleVariables/StyleVariable.tsx
|
|
9
|
+
//#region src/builder/components/StyleVariables/StyleVariable.tsx
|
|
10
10
|
var u = ({ category: u, name: d, value: f, onUpdate: p, onRemove: m }) => {
|
|
11
11
|
let [h, g] = o(!1), [_, v] = o(!1), y = a((e) => {
|
|
12
12
|
e.stopPropagation(), g(!0);
|
|
@@ -5,7 +5,7 @@ import i from "@plitzi/plitzi-ui/Button";
|
|
|
5
5
|
import a from "clsx";
|
|
6
6
|
import { jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
7
7
|
import { StyleVariableCategory as c } from "@plitzi/sdk-shared";
|
|
8
|
-
//#region src/components/StyleVariables/StyleVariables.tsx
|
|
8
|
+
//#region src/builder/components/StyleVariables/StyleVariables.tsx
|
|
9
9
|
var l = ({ className: l, variables: u = {
|
|
10
10
|
color: {},
|
|
11
11
|
spacing: {},
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { NOT_COPIED_REASON as e, copyText as t } from "@plitzi/sdk-shared/helpers";
|
|
2
|
+
import { useCallback as n } from "react";
|
|
3
|
+
import { jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
4
|
+
import { useToast as a } from "@plitzi/plitzi-ui/Toast";
|
|
5
|
+
//#region src/builder/components/StyleVariables/VariableDetails.tsx
|
|
6
|
+
var o = ({ name: o }) => {
|
|
7
|
+
let { addToast: s } = a(), c = n(() => {
|
|
8
|
+
t(`var(--${o})`).then((t) => s(t ? "Variable copied into the clipboard" : e, {
|
|
9
|
+
appeareance: t ? "success" : "error",
|
|
10
|
+
autoDismiss: !0,
|
|
11
|
+
placement: "top-right"
|
|
12
|
+
}));
|
|
13
|
+
}, [s, o]);
|
|
14
|
+
return /* @__PURE__ */ i("div", {
|
|
15
|
+
className: "flex w-full items-center justify-between gap-2",
|
|
16
|
+
children: [/* @__PURE__ */ i("div", {
|
|
17
|
+
className: "flex gap-1",
|
|
18
|
+
children: ["Token:", /* @__PURE__ */ r("div", {
|
|
19
|
+
className: "truncate font-bold",
|
|
20
|
+
title: o,
|
|
21
|
+
children: `var(--${o})`
|
|
22
|
+
})]
|
|
23
|
+
}), /* @__PURE__ */ r("i", {
|
|
24
|
+
className: "fa-solid fa-copy cursor-pointer hover:text-blue-400",
|
|
25
|
+
onClick: c,
|
|
26
|
+
title: "Copy"
|
|
27
|
+
})]
|
|
28
|
+
});
|
|
29
|
+
};
|
|
30
|
+
//#endregion
|
|
31
|
+
export { o as default };
|
|
@@ -2,7 +2,7 @@ import e from "./StyleVariable.mjs";
|
|
|
2
2
|
import { jsx as t, jsxs as n } from "react/jsx-runtime";
|
|
3
3
|
import r from "@plitzi/plitzi-ui/ContainerCollapsable";
|
|
4
4
|
import i from "@plitzi/plitzi-ui/Icon";
|
|
5
|
-
//#region src/components/StyleVariables/VariableGroup.tsx
|
|
5
|
+
//#region src/builder/components/StyleVariables/VariableGroup.tsx
|
|
6
6
|
var a = ({ category: a, variables: o = {}, onUpdate: s, onRemove: c }) => {
|
|
7
7
|
let l = Object.keys(o).length;
|
|
8
8
|
return /* @__PURE__ */ n(r, {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import e from "./VariableGroup.mjs";
|
|
2
2
|
import { jsx as t } from "react/jsx-runtime";
|
|
3
3
|
import { StyleVariableCategory as n } from "@plitzi/sdk-shared";
|
|
4
|
-
//#region src/components/StyleVariables/VariableList.tsx
|
|
4
|
+
//#region src/builder/components/StyleVariables/VariableList.tsx
|
|
5
5
|
var r = ({ variables: r, onUpdate: i, onRemove: a }) => {
|
|
6
6
|
if (r) return /* @__PURE__ */ t("div", {
|
|
7
7
|
className: "flex grow flex-col overflow-y-auto",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useMemo as e } from "react";
|
|
2
2
|
import { jsx as t, jsxs as n } from "react/jsx-runtime";
|
|
3
|
-
//#region src/components/StyleVariables/VariableValue.tsx
|
|
3
|
+
//#region src/builder/components/StyleVariables/VariableValue.tsx
|
|
4
4
|
var r = ({ type: r, value: i }) => {
|
|
5
5
|
let a = e(() => typeof i == "object" ? Object.keys(i).sort((e) => e === "default" ? -1 : 1) : [], [i]);
|
|
6
6
|
return /* @__PURE__ */ n("div", {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import e from "@plitzi/plitzi-ui/Button";
|
|
2
2
|
import t from "clsx";
|
|
3
3
|
import { jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
4
|
-
//#region src/components/VariableActions/VariableActions.tsx
|
|
4
|
+
//#region src/builder/components/VariableActions/VariableActions.tsx
|
|
5
5
|
var i = ({ onUpdate: i, onRemove: a, selected: o = !1 }) => /* @__PURE__ */ r("div", {
|
|
6
6
|
className: t("flex items-center gap-2 text-xs", {
|
|
7
7
|
flex: o,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { __exportAll as e } from "
|
|
1
|
+
import { __exportAll as e } from "../../_virtual/_rolldown/runtime.mjs";
|
|
2
2
|
import t from "./SchemaVariables/index.mjs";
|
|
3
3
|
import n from "./StyleVariables/index.mjs";
|
|
4
|
-
//#region src/components/index.ts
|
|
4
|
+
//#region src/builder/components/index.ts
|
|
5
5
|
var r = /* @__PURE__ */ e({
|
|
6
6
|
SchemaVariables: () => t,
|
|
7
7
|
StyleVariables: () => n
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The variables the builder edits — the schema's and the style's lists and their forms. An entry of its own so the
|
|
3
|
+
* package's root (the CSS a space's variables compile to) loads none of it where nothing is edited.
|
|
4
|
+
*/
|
|
5
|
+
import * as components from './components';
|
|
6
|
+
import * as forms from './models';
|
|
7
|
+
export * from './components';
|
|
8
|
+
export * from './models';
|
|
9
|
+
export { components, forms };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { schemaVariableFormSchema as e } from "./models/SchemaVariableForm/SchemaVariableForm.mjs";
|
|
2
|
+
import t from "./models/SchemaVariableForm/index.mjs";
|
|
3
|
+
import n from "./components/SchemaVariables/index.mjs";
|
|
4
|
+
import { styleVariableFormSchema as r } from "./models/StyleVariableForm/StyleVariableForm.mjs";
|
|
5
|
+
import i from "./models/StyleVariableForm/index.mjs";
|
|
6
|
+
import { models_exports as a } from "./models/index.mjs";
|
|
7
|
+
import o from "./components/StyleVariables/index.mjs";
|
|
8
|
+
import { components_exports as s } from "./components/index.mjs";
|
|
9
|
+
export { t as SchemaVariableForm, n as SchemaVariables, i as StyleVariableForm, o as StyleVariables, s as components, a as forms, e as schemaVariableFormSchema, r as styleVariableFormSchema };
|
|
@@ -6,7 +6,7 @@ import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
|
6
6
|
import o from "@plitzi/plitzi-ui/Alert";
|
|
7
7
|
import s, { useFieldArray as c, useForm as l, useFormWatch as u } from "@plitzi/plitzi-ui/Form";
|
|
8
8
|
import { z as d } from "zod";
|
|
9
|
-
//#region src/models/SchemaVariableForm/SchemaVariableForm.tsx
|
|
9
|
+
//#region src/builder/models/SchemaVariableForm/SchemaVariableForm.tsx
|
|
10
10
|
var f = d.object({
|
|
11
11
|
name: d.string().min(4).regex(/^(?:\w+\s+|)([a-zA-Z_][a-zA-Z0-9_]+)$/i, { message: "Name only can be letters, numbers and _ -" }),
|
|
12
12
|
category: d.string(),
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import e from "./VariableValue.mjs";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import i from "
|
|
5
|
-
import a from "@plitzi/plitzi-ui/
|
|
6
|
-
import o from "@plitzi/plitzi-ui/
|
|
7
|
-
import
|
|
8
|
-
//#region src/models/SchemaVariableForm/VariableSubValue.tsx
|
|
2
|
+
import { getPathsFromObject as t } from "@plitzi/sdk-shared/helpers";
|
|
3
|
+
import { useMemo as n } from "react";
|
|
4
|
+
import { jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
5
|
+
import a from "@plitzi/plitzi-ui/QueryBuilder";
|
|
6
|
+
import o from "@plitzi/plitzi-ui/Form";
|
|
7
|
+
import s from "@plitzi/plitzi-ui/Heading";
|
|
8
|
+
//#region src/builder/models/SchemaVariableForm/VariableSubValue.tsx
|
|
9
9
|
var c = ({ index: c = 0, valueType: l = "text", whenData: u, indexLimit: d, onClickRemove: f, onClickUp: p, onClickDown: m }) => {
|
|
10
|
-
let h =
|
|
10
|
+
let h = n(() => t(u).reduce((e, t) => ({
|
|
11
11
|
...e,
|
|
12
12
|
[t]: {
|
|
13
13
|
name: t,
|
|
@@ -15,9 +15,9 @@ var c = ({ index: c = 0, valueType: l = "text", whenData: u, indexLimit: d, onCl
|
|
|
15
15
|
placeholder: `Enter ${t}`
|
|
16
16
|
}
|
|
17
17
|
}), {}), [u]);
|
|
18
|
-
return /* @__PURE__ */
|
|
18
|
+
return /* @__PURE__ */ i("div", {
|
|
19
19
|
className: "flex min-w-0 grow basis-0 flex-col gap-3 rounded-sm border border-gray-300 p-2",
|
|
20
|
-
children: [/* @__PURE__ */
|
|
20
|
+
children: [/* @__PURE__ */ r(e, {
|
|
21
21
|
valueType: l,
|
|
22
22
|
name: `subValues.${c}.value`,
|
|
23
23
|
isSubValue: !0,
|
|
@@ -26,25 +26,25 @@ var c = ({ index: c = 0, valueType: l = "text", whenData: u, indexLimit: d, onCl
|
|
|
26
26
|
onClickRemove: f,
|
|
27
27
|
onClickUp: p,
|
|
28
28
|
onClickDown: m
|
|
29
|
-
}), /* @__PURE__ */
|
|
29
|
+
}), /* @__PURE__ */ r(o.Custom, {
|
|
30
30
|
name: `subValues.${c}.when`,
|
|
31
|
-
render: ({ field: { ref: e, value: t, onChange:
|
|
31
|
+
render: ({ field: { ref: e, value: t, onChange: n }, fieldState: { error: o } }) => /* @__PURE__ */ i("div", {
|
|
32
32
|
className: "flex flex-col gap-1",
|
|
33
33
|
ref: e,
|
|
34
|
-
children: [/* @__PURE__ */
|
|
34
|
+
children: [/* @__PURE__ */ r(s, {
|
|
35
35
|
as: "h5",
|
|
36
36
|
children: "When Happens"
|
|
37
|
-
}), /* @__PURE__ */
|
|
37
|
+
}), /* @__PURE__ */ r("div", {
|
|
38
38
|
className: "flex flex-col",
|
|
39
|
-
children: /* @__PURE__ */
|
|
39
|
+
children: /* @__PURE__ */ r(a, {
|
|
40
40
|
direction: "vertical",
|
|
41
41
|
intent: "gray",
|
|
42
42
|
className: "w-full",
|
|
43
43
|
query: t,
|
|
44
44
|
fields: h,
|
|
45
|
-
onChange:
|
|
45
|
+
onChange: n,
|
|
46
46
|
showBranches: !0,
|
|
47
|
-
error: !!
|
|
47
|
+
error: !!o?.message
|
|
48
48
|
})
|
|
49
49
|
})]
|
|
50
50
|
})
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import e from "@plitzi/plitzi-ui/Button";
|
|
2
2
|
import { jsx as t, jsxs as n } from "react/jsx-runtime";
|
|
3
|
-
//#region src/models/SchemaVariableForm/VariableSubValueActions.tsx
|
|
3
|
+
//#region src/builder/models/SchemaVariableForm/VariableSubValueActions.tsx
|
|
4
4
|
var r = ({ indexLimit: r = 0, index: i = 0, onClickRemove: a, onClickUp: o, onClickDown: s }) => /* @__PURE__ */ n("div", {
|
|
5
5
|
className: "flex gap-2",
|
|
6
6
|
children: [
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import e from "./VariableSubValueActions.mjs";
|
|
2
2
|
import { jsx as t, jsxs as n } from "react/jsx-runtime";
|
|
3
3
|
import r from "@plitzi/plitzi-ui/Form";
|
|
4
|
-
//#region src/models/SchemaVariableForm/VariableValue.tsx
|
|
4
|
+
//#region src/builder/models/SchemaVariableForm/VariableValue.tsx
|
|
5
5
|
var i = ({ valueType: i = "text", hasSubValues: a = !1, name: o = "value", index: s, indexLimit: c, isSubValue: l = !1, onClickRemove: u, onClickUp: d, onClickDown: f }) => {
|
|
6
6
|
let p = a ? "Fallback Value" : "Value", m = {
|
|
7
7
|
name: o,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import e, { schemaVariableFormSchema as t } from "./SchemaVariableForm.mjs";
|
|
2
|
-
//#region src/models/SchemaVariableForm/index.ts
|
|
2
|
+
//#region src/builder/models/SchemaVariableForm/index.ts
|
|
3
3
|
var n = e;
|
|
4
4
|
//#endregion
|
|
5
5
|
export { n as default, t as schemaVariableFormSchema };
|
|
@@ -4,7 +4,7 @@ import { jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
|
4
4
|
import a, { useForm as o, useFormWatch as s } from "@plitzi/plitzi-ui/Form";
|
|
5
5
|
import { z as c } from "zod";
|
|
6
6
|
import { StyleVariableCategory as l, isStyleVariableCategory as u } from "@plitzi/sdk-shared";
|
|
7
|
-
//#region src/models/StyleVariableForm/StyleVariableForm.tsx
|
|
7
|
+
//#region src/builder/models/StyleVariableForm/StyleVariableForm.tsx
|
|
8
8
|
var d = c.string().min(3, "Too Short").max(20, "Too Long").regex(/^(?:\w+\s+|)([a-zA-Z_][a-zA-Z0-9_-]+)$/i, "Invalid Name"), f = c.discriminatedUnion("category", [
|
|
9
9
|
c.object({
|
|
10
10
|
name: d,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { __exportAll as e } from "
|
|
1
|
+
import { __exportAll as e } from "../../_virtual/_rolldown/runtime.mjs";
|
|
2
2
|
import { schemaVariableFormSchema as t } from "./SchemaVariableForm/SchemaVariableForm.mjs";
|
|
3
3
|
import n from "./SchemaVariableForm/index.mjs";
|
|
4
4
|
import { styleVariableFormSchema as r } from "./StyleVariableForm/StyleVariableForm.mjs";
|
|
5
5
|
import i from "./StyleVariableForm/index.mjs";
|
|
6
|
-
//#region src/models/index.ts
|
|
6
|
+
//#region src/builder/models/index.ts
|
|
7
7
|
var a = /* @__PURE__ */ e({
|
|
8
8
|
SchemaVariableForm: () => n,
|
|
9
9
|
StyleVariableForm: () => i,
|
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,5 @@
|
|
|
1
1
|
import { default as VariablesContext } from './VariablesContext';
|
|
2
2
|
import { schemaVariablesToCss, styleVariablesToCss } from './VariablesHelper';
|
|
3
|
-
import * as components from './components';
|
|
4
|
-
import * as forms from './models';
|
|
5
|
-
export * from './models';
|
|
6
|
-
export * from './components';
|
|
7
3
|
export * from './VariablesContext';
|
|
8
4
|
export * from './VariablesHelper';
|
|
9
|
-
export { VariablesContext, schemaVariablesToCss, styleVariablesToCss
|
|
5
|
+
export { VariablesContext, schemaVariablesToCss, styleVariablesToCss };
|
package/dist/index.mjs
CHANGED
|
@@ -1,11 +1,3 @@
|
|
|
1
1
|
import e from "./VariablesContext.mjs";
|
|
2
2
|
import { schemaVariablesToCss as t, styleSelectorVariablesToCss as n, styleVariablesToCss as r } from "./VariablesHelper.mjs";
|
|
3
|
-
|
|
4
|
-
import a from "./models/SchemaVariableForm/index.mjs";
|
|
5
|
-
import o from "./components/SchemaVariables/index.mjs";
|
|
6
|
-
import { styleVariableFormSchema as s } from "./models/StyleVariableForm/StyleVariableForm.mjs";
|
|
7
|
-
import c from "./models/StyleVariableForm/index.mjs";
|
|
8
|
-
import { models_exports as l } from "./models/index.mjs";
|
|
9
|
-
import u from "./components/StyleVariables/index.mjs";
|
|
10
|
-
import { components_exports as d } from "./components/index.mjs";
|
|
11
|
-
export { a as SchemaVariableForm, o as SchemaVariables, c as StyleVariableForm, u as StyleVariables, e as VariablesContext, d as components, l as forms, i as schemaVariableFormSchema, t as schemaVariablesToCss, n as styleSelectorVariablesToCss, s as styleVariableFormSchema, r as styleVariablesToCss };
|
|
3
|
+
export { e as VariablesContext, t as schemaVariablesToCss, n as styleSelectorVariablesToCss, r as styleVariablesToCss };
|
package/package.json
CHANGED
|
@@ -1,146 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plitzi/sdk-variables",
|
|
3
|
-
"version": "0.38.
|
|
3
|
+
"version": "0.38.18",
|
|
4
4
|
"license": "AGPL-3.0",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist"
|
|
7
7
|
],
|
|
8
8
|
"exports": {
|
|
9
9
|
".": {
|
|
10
|
+
"@plitzi/source": "./src/index.ts",
|
|
10
11
|
"types": "./dist/index.d.ts",
|
|
11
12
|
"import": "./dist/index.mjs"
|
|
12
13
|
},
|
|
13
|
-
"
|
|
14
|
-
"
|
|
15
|
-
"
|
|
16
|
-
|
|
17
|
-
"./VariablesHelper": {
|
|
18
|
-
"types": "./dist/VariablesHelper.d.ts",
|
|
19
|
-
"import": "./dist/VariablesHelper.mjs"
|
|
20
|
-
},
|
|
21
|
-
"./components": {
|
|
22
|
-
"types": "./dist/components/index.d.ts",
|
|
23
|
-
"import": "./dist/components/index.mjs"
|
|
24
|
-
},
|
|
25
|
-
"./components/SchemaVariables": {
|
|
26
|
-
"types": "./dist/components/SchemaVariables/index.d.ts",
|
|
27
|
-
"import": "./dist/components/SchemaVariables/index.mjs"
|
|
28
|
-
},
|
|
29
|
-
"./components/SchemaVariables/SchemaVariable": {
|
|
30
|
-
"types": "./dist/components/SchemaVariables/SchemaVariable.d.ts",
|
|
31
|
-
"import": "./dist/components/SchemaVariables/SchemaVariable.mjs"
|
|
32
|
-
},
|
|
33
|
-
"./components/SchemaVariables/SchemaVariables": {
|
|
34
|
-
"types": "./dist/components/SchemaVariables/SchemaVariables.d.ts",
|
|
35
|
-
"import": "./dist/components/SchemaVariables/SchemaVariables.mjs"
|
|
36
|
-
},
|
|
37
|
-
"./components/SchemaVariables/VariableDetails": {
|
|
38
|
-
"types": "./dist/components/SchemaVariables/VariableDetails.d.ts",
|
|
39
|
-
"import": "./dist/components/SchemaVariables/VariableDetails.mjs"
|
|
40
|
-
},
|
|
41
|
-
"./components/SchemaVariables/VariableValue": {
|
|
42
|
-
"types": "./dist/components/SchemaVariables/VariableValue.d.ts",
|
|
43
|
-
"import": "./dist/components/SchemaVariables/VariableValue.mjs"
|
|
44
|
-
},
|
|
45
|
-
"./components/SchemaVariables/index": {
|
|
46
|
-
"types": "./dist/components/SchemaVariables/index.d.ts",
|
|
47
|
-
"import": "./dist/components/SchemaVariables/index.mjs"
|
|
48
|
-
},
|
|
49
|
-
"./components/StyleVariables": {
|
|
50
|
-
"types": "./dist/components/StyleVariables/index.d.ts",
|
|
51
|
-
"import": "./dist/components/StyleVariables/index.mjs"
|
|
52
|
-
},
|
|
53
|
-
"./components/StyleVariables/StyleVariable": {
|
|
54
|
-
"types": "./dist/components/StyleVariables/StyleVariable.d.ts",
|
|
55
|
-
"import": "./dist/components/StyleVariables/StyleVariable.mjs"
|
|
56
|
-
},
|
|
57
|
-
"./components/StyleVariables/StyleVariables": {
|
|
58
|
-
"types": "./dist/components/StyleVariables/StyleVariables.d.ts",
|
|
59
|
-
"import": "./dist/components/StyleVariables/StyleVariables.mjs"
|
|
60
|
-
},
|
|
61
|
-
"./components/StyleVariables/VariableDetails": {
|
|
62
|
-
"types": "./dist/components/StyleVariables/VariableDetails.d.ts",
|
|
63
|
-
"import": "./dist/components/StyleVariables/VariableDetails.mjs"
|
|
64
|
-
},
|
|
65
|
-
"./components/StyleVariables/VariableGroup": {
|
|
66
|
-
"types": "./dist/components/StyleVariables/VariableGroup.d.ts",
|
|
67
|
-
"import": "./dist/components/StyleVariables/VariableGroup.mjs"
|
|
68
|
-
},
|
|
69
|
-
"./components/StyleVariables/VariableList": {
|
|
70
|
-
"types": "./dist/components/StyleVariables/VariableList.d.ts",
|
|
71
|
-
"import": "./dist/components/StyleVariables/VariableList.mjs"
|
|
72
|
-
},
|
|
73
|
-
"./components/StyleVariables/VariableValue": {
|
|
74
|
-
"types": "./dist/components/StyleVariables/VariableValue.d.ts",
|
|
75
|
-
"import": "./dist/components/StyleVariables/VariableValue.mjs"
|
|
76
|
-
},
|
|
77
|
-
"./components/StyleVariables/index": {
|
|
78
|
-
"types": "./dist/components/StyleVariables/index.d.ts",
|
|
79
|
-
"import": "./dist/components/StyleVariables/index.mjs"
|
|
80
|
-
},
|
|
81
|
-
"./components/VariableActions": {
|
|
82
|
-
"types": "./dist/components/VariableActions/index.d.ts",
|
|
83
|
-
"import": "./dist/components/VariableActions/index.mjs"
|
|
84
|
-
},
|
|
85
|
-
"./components/VariableActions/VariableActions": {
|
|
86
|
-
"types": "./dist/components/VariableActions/VariableActions.d.ts",
|
|
87
|
-
"import": "./dist/components/VariableActions/VariableActions.mjs"
|
|
88
|
-
},
|
|
89
|
-
"./components/VariableActions/index": {
|
|
90
|
-
"types": "./dist/components/VariableActions/index.d.ts",
|
|
91
|
-
"import": "./dist/components/VariableActions/index.mjs"
|
|
92
|
-
},
|
|
93
|
-
"./components/index": {
|
|
94
|
-
"types": "./dist/components/index.d.ts",
|
|
95
|
-
"import": "./dist/components/index.mjs"
|
|
96
|
-
},
|
|
97
|
-
"./index": {
|
|
98
|
-
"types": "./dist/index.d.ts",
|
|
99
|
-
"import": "./dist/index.mjs"
|
|
100
|
-
},
|
|
101
|
-
"./models": {
|
|
102
|
-
"types": "./dist/models/index.d.ts",
|
|
103
|
-
"import": "./dist/models/index.mjs"
|
|
104
|
-
},
|
|
105
|
-
"./models/SchemaVariableForm": {
|
|
106
|
-
"types": "./dist/models/SchemaVariableForm/index.d.ts",
|
|
107
|
-
"import": "./dist/models/SchemaVariableForm/index.mjs"
|
|
108
|
-
},
|
|
109
|
-
"./models/SchemaVariableForm/SchemaVariableForm": {
|
|
110
|
-
"types": "./dist/models/SchemaVariableForm/SchemaVariableForm.d.ts",
|
|
111
|
-
"import": "./dist/models/SchemaVariableForm/SchemaVariableForm.mjs"
|
|
112
|
-
},
|
|
113
|
-
"./models/SchemaVariableForm/VariableSubValue": {
|
|
114
|
-
"types": "./dist/models/SchemaVariableForm/VariableSubValue.d.ts",
|
|
115
|
-
"import": "./dist/models/SchemaVariableForm/VariableSubValue.mjs"
|
|
116
|
-
},
|
|
117
|
-
"./models/SchemaVariableForm/VariableSubValueActions": {
|
|
118
|
-
"types": "./dist/models/SchemaVariableForm/VariableSubValueActions.d.ts",
|
|
119
|
-
"import": "./dist/models/SchemaVariableForm/VariableSubValueActions.mjs"
|
|
120
|
-
},
|
|
121
|
-
"./models/SchemaVariableForm/VariableValue": {
|
|
122
|
-
"types": "./dist/models/SchemaVariableForm/VariableValue.d.ts",
|
|
123
|
-
"import": "./dist/models/SchemaVariableForm/VariableValue.mjs"
|
|
124
|
-
},
|
|
125
|
-
"./models/SchemaVariableForm/index": {
|
|
126
|
-
"types": "./dist/models/SchemaVariableForm/index.d.ts",
|
|
127
|
-
"import": "./dist/models/SchemaVariableForm/index.mjs"
|
|
128
|
-
},
|
|
129
|
-
"./models/StyleVariableForm": {
|
|
130
|
-
"types": "./dist/models/StyleVariableForm/index.d.ts",
|
|
131
|
-
"import": "./dist/models/StyleVariableForm/index.mjs"
|
|
132
|
-
},
|
|
133
|
-
"./models/StyleVariableForm/StyleVariableForm": {
|
|
134
|
-
"types": "./dist/models/StyleVariableForm/StyleVariableForm.d.ts",
|
|
135
|
-
"import": "./dist/models/StyleVariableForm/StyleVariableForm.mjs"
|
|
136
|
-
},
|
|
137
|
-
"./models/StyleVariableForm/index": {
|
|
138
|
-
"types": "./dist/models/StyleVariableForm/index.d.ts",
|
|
139
|
-
"import": "./dist/models/StyleVariableForm/index.mjs"
|
|
140
|
-
},
|
|
141
|
-
"./models/index": {
|
|
142
|
-
"types": "./dist/models/index.d.ts",
|
|
143
|
-
"import": "./dist/models/index.mjs"
|
|
14
|
+
"./*": {
|
|
15
|
+
"@plitzi/source": "./src/*/index.ts",
|
|
16
|
+
"types": "./dist/*/index.d.ts",
|
|
17
|
+
"import": "./dist/*/index.mjs"
|
|
144
18
|
}
|
|
145
19
|
},
|
|
146
20
|
"type": "module",
|
|
@@ -148,24 +22,24 @@
|
|
|
148
22
|
"scripts": {
|
|
149
23
|
"lint": "eslint ./src",
|
|
150
24
|
"typecheck": "tsc -p tsconfig.app.json --noEmit",
|
|
151
|
-
"build:dev": "vite build --mode development --minify false
|
|
25
|
+
"build:dev": "vite build --mode development --minify false",
|
|
152
26
|
"build:dev-watch": "vite build --mode development --watch --minify false",
|
|
153
|
-
"build:prod": "vite build
|
|
27
|
+
"build:prod": "vite build",
|
|
154
28
|
"test": "vitest run",
|
|
155
29
|
"test:watch": "vitest"
|
|
156
30
|
},
|
|
157
31
|
"dependencies": {
|
|
158
32
|
"@plitzi/plitzi-ui": "^1.6.33",
|
|
159
|
-
"@plitzi/sdk-shared": "0.38.
|
|
33
|
+
"@plitzi/sdk-shared": "0.38.18",
|
|
160
34
|
"clsx": "^2.1.1",
|
|
161
|
-
"zod": "^4.6.
|
|
35
|
+
"zod": "^4.6.7"
|
|
162
36
|
},
|
|
163
37
|
"devDependencies": {
|
|
164
38
|
"eslint": "^9.39.5",
|
|
165
|
-
"react": "^19.3.
|
|
39
|
+
"react": "^19.3.1",
|
|
166
40
|
"typescript": "^6.0.3",
|
|
167
|
-
"vite": "^8.3.
|
|
168
|
-
"vitest": "^5.0.
|
|
41
|
+
"vite": "^8.3.4",
|
|
42
|
+
"vitest": "^5.0.5"
|
|
169
43
|
},
|
|
170
44
|
"peerDependencies": {
|
|
171
45
|
"react": "^19"
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { useCallback as e } from "react";
|
|
2
|
-
import { jsx as t, jsxs as n } from "react/jsx-runtime";
|
|
3
|
-
import { useToast as r } from "@plitzi/plitzi-ui/Toast";
|
|
4
|
-
import { NOT_COPIED_REASON as i, copyText as a } from "@plitzi/sdk-shared/helpers/clipboard";
|
|
5
|
-
//#region src/components/StyleVariables/VariableDetails.tsx
|
|
6
|
-
var o = ({ name: o }) => {
|
|
7
|
-
let { addToast: s } = r(), c = e(() => {
|
|
8
|
-
a(`var(--${o})`).then((e) => s(e ? "Variable copied into the clipboard" : i, {
|
|
9
|
-
appeareance: e ? "success" : "error",
|
|
10
|
-
autoDismiss: !0,
|
|
11
|
-
placement: "top-right"
|
|
12
|
-
}));
|
|
13
|
-
}, [s, o]);
|
|
14
|
-
return /* @__PURE__ */ n("div", {
|
|
15
|
-
className: "flex w-full items-center justify-between gap-2",
|
|
16
|
-
children: [/* @__PURE__ */ n("div", {
|
|
17
|
-
className: "flex gap-1",
|
|
18
|
-
children: ["Token:", /* @__PURE__ */ t("div", {
|
|
19
|
-
className: "truncate font-bold",
|
|
20
|
-
title: o,
|
|
21
|
-
children: `var(--${o})`
|
|
22
|
-
})]
|
|
23
|
-
}), /* @__PURE__ */ t("i", {
|
|
24
|
-
className: "fa-solid fa-copy cursor-pointer hover:text-blue-400",
|
|
25
|
-
onClick: c,
|
|
26
|
-
title: "Copy"
|
|
27
|
-
})]
|
|
28
|
-
});
|
|
29
|
-
};
|
|
30
|
-
//#endregion
|
|
31
|
-
export { o as default };
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|