@kardalum/plugin-sdk 0.16.0 → 0.17.0
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 +38 -0
- package/dist/admin-section-registry.d.ts +14 -5
- package/dist/admin-section-registry.js +14 -4
- package/dist/capabilities.js +0 -3
- package/dist/host-entry.d.ts +1 -1
- package/dist/host-entry.js +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +8 -8
- package/dist/license-verdict-keys.d.ts +4 -3
- package/dist/license-verdict-keys.js +4 -7
- package/dist/manifest-entry.d.ts +2 -2
- package/dist/manifest-entry.js +1 -1
- package/dist/manifest-schema.d.ts +51 -62
- package/dist/manifest-schema.js +97 -249
- package/dist/manifest.d.ts +41 -73
- package/dist/manifest.js +13 -36
- package/dist/plugin-screen-context.d.ts +11 -1
- package/dist/richtext/block-panel.js +2 -2
- package/dist/richtext/insert-menu.js +1 -1
- package/dist/richtext/style-listbox.js +4 -4
- package/dist/tokens/tokens.css +1 -0
- package/dist/tokens/tokens.json +2 -1
- package/dist/type-equality.d.ts +2 -0
- package/dist/type-equality.js +1 -0
- package/dist/views/html-view.js +1 -1
- package/dist/views/rich-text-view.js +1 -1
- package/node_modules/@kardalum/api-schemas/dist/asset-api.schema.d.ts +90 -0
- package/node_modules/@kardalum/api-schemas/dist/asset-api.schema.js +32 -1
- package/node_modules/@kardalum/api-schemas/dist/asset.schema.d.ts +22 -1
- package/node_modules/@kardalum/api-schemas/dist/asset.schema.js +50 -15
- package/node_modules/@kardalum/api-schemas/dist/audit-api.schema.d.ts +204 -0
- package/node_modules/@kardalum/api-schemas/dist/audit-api.schema.js +134 -0
- package/node_modules/@kardalum/api-schemas/dist/content-api.schema.js +6 -5
- package/node_modules/@kardalum/api-schemas/dist/content-list.schema.d.ts +2 -2
- package/node_modules/@kardalum/api-schemas/dist/content-trash-api.schema.d.ts +4 -0
- package/node_modules/@kardalum/api-schemas/dist/content-trash-api.schema.js +3 -0
- package/node_modules/@kardalum/api-schemas/dist/content-trash.schema.js +2 -1
- package/node_modules/@kardalum/api-schemas/dist/core-actions.d.ts +41 -5
- package/node_modules/@kardalum/api-schemas/dist/core-actions.js +23 -9
- package/node_modules/@kardalum/api-schemas/dist/index.d.ts +36 -20
- package/node_modules/@kardalum/api-schemas/dist/index.js +21 -11
- package/node_modules/@kardalum/api-schemas/dist/install-warnings.schema.d.ts +4 -0
- package/node_modules/@kardalum/api-schemas/dist/install-warnings.schema.js +8 -0
- package/node_modules/@kardalum/api-schemas/dist/issue-list.d.ts +6 -0
- package/node_modules/@kardalum/api-schemas/dist/issue-list.js +6 -0
- package/node_modules/@kardalum/api-schemas/dist/marketplace-listing-api.schema.d.ts +101 -62
- package/node_modules/@kardalum/api-schemas/dist/marketplace-listing-api.schema.js +15 -4
- package/node_modules/@kardalum/api-schemas/dist/plugin-actions.schema.d.ts +6 -2
- package/node_modules/@kardalum/api-schemas/dist/plugin-actions.schema.js +8 -6
- package/node_modules/@kardalum/api-schemas/dist/plugin-docs-api.schema.d.ts +1 -16
- package/node_modules/@kardalum/api-schemas/dist/plugin-docs.d.ts +3 -19
- package/node_modules/@kardalum/api-schemas/dist/plugin-docs.js +13 -15
- package/node_modules/@kardalum/api-schemas/dist/plugin-id-rules.d.ts +17 -7
- package/node_modules/@kardalum/api-schemas/dist/plugin-id-rules.js +18 -8
- package/node_modules/@kardalum/api-schemas/dist/plugin-install-record.schema.d.ts +1 -1
- package/node_modules/@kardalum/api-schemas/dist/plugin-install.d.ts +97 -85
- package/node_modules/@kardalum/api-schemas/dist/plugin-install.js +35 -68
- package/node_modules/@kardalum/api-schemas/dist/plugin-labels.d.ts +60 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-labels.js +116 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-locales.d.ts +9 -2
- package/node_modules/@kardalum/api-schemas/dist/plugin-locales.js +22 -7
- package/node_modules/@kardalum/api-schemas/dist/plugin-management-api.schema.d.ts +13 -6
- package/node_modules/@kardalum/api-schemas/dist/plugin-management-api.schema.js +7 -1
- package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-actions.d.ts +4 -3
- package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-actions.js +1 -1
- package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-api-routes.d.ts +14 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-api-routes.js +37 -1
- package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-fields.d.ts +64 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-fields.js +134 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-registry-api.schema.d.ts +2 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-registry-api.schema.js +4 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-template-payload.d.ts +74 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-template-payload.js +132 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-vocabulary.d.ts +13 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-vocabulary.js +15 -0
- package/node_modules/@kardalum/api-schemas/dist/public-api.schema.js +12 -3
- package/node_modules/@kardalum/api-schemas/dist/role.schema.d.ts +11 -0
- package/node_modules/@kardalum/api-schemas/dist/role.schema.js +7 -0
- package/node_modules/@kardalum/api-schemas/dist/sample-content.schema.d.ts +11 -2
- package/node_modules/@kardalum/api-schemas/dist/sample-content.schema.js +21 -3
- package/node_modules/@kardalum/api-schemas/dist/sandbox-attach.schema.d.ts +126 -0
- package/node_modules/@kardalum/api-schemas/dist/sandbox-attach.schema.js +70 -0
- package/node_modules/@kardalum/api-schemas/dist/setup-api.schema.d.ts +6 -6
- package/node_modules/@kardalum/api-schemas/dist/sites.schema.d.ts +44 -25
- package/node_modules/@kardalum/api-schemas/dist/sites.schema.js +187 -48
- package/node_modules/@kardalum/api-schemas/dist/snapshot-api.schema.d.ts +15 -3
- package/node_modules/@kardalum/api-schemas/dist/snapshot-api.schema.js +14 -0
- package/node_modules/@kardalum/api-schemas/dist/snapshot.schema.d.ts +1 -1
- package/node_modules/@kardalum/api-schemas/dist/strict-url.d.ts +12 -0
- package/node_modules/@kardalum/api-schemas/dist/strict-url.js +31 -0
- package/node_modules/@kardalum/api-schemas/dist/template-api.schema.d.ts +105 -1
- package/node_modules/@kardalum/api-schemas/dist/template-api.schema.js +43 -3
- package/node_modules/@kardalum/api-schemas/dist/template.schema.d.ts +30 -2
- package/node_modules/@kardalum/api-schemas/dist/template.schema.js +19 -5
- package/node_modules/@kardalum/api-schemas/dist/trash-cursor.schema.d.ts +4 -0
- package/node_modules/@kardalum/api-schemas/dist/trash-cursor.schema.js +29 -0
- package/node_modules/@kardalum/api-schemas/dist/user-api.schema.d.ts +4 -0
- package/node_modules/@kardalum/api-schemas/dist/user-api.schema.js +3 -0
- package/node_modules/@kardalum/api-schemas/dist/whoami-api.schema.d.ts +19 -0
- package/node_modules/@kardalum/api-schemas/dist/whoami-api.schema.js +22 -0
- package/node_modules/@kardalum/api-schemas/package.json +2 -2
- package/node_modules/@kardalum/design-tokens/dist/tailwind-theme.d.ts +1 -0
- package/node_modules/@kardalum/design-tokens/dist/tailwind-theme.js +2 -0
- package/node_modules/@kardalum/design-tokens/dist/tokens.css +1 -0
- package/node_modules/@kardalum/design-tokens/dist/tokens.js +3 -0
- package/node_modules/@kardalum/design-tokens/dist/tokens.json +2 -1
- package/node_modules/@kardalum/design-tokens/dist/types.d.ts +1 -0
- package/node_modules/@kardalum/plugin-package/README.md +4 -1
- package/node_modules/@kardalum/plugin-package/dist/build-reference.d.ts +6 -21
- package/node_modules/@kardalum/plugin-package/dist/build-reference.js +13 -8
- package/node_modules/@kardalum/plugin-package/dist/capabilities.d.ts +4 -4
- package/node_modules/@kardalum/plugin-package/dist/capabilities.js +9 -14
- package/node_modules/@kardalum/plugin-package/dist/client-bundle.d.ts +4 -0
- package/node_modules/@kardalum/plugin-package/dist/client-bundle.js +25 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/archive-names.d.ts +25 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/archive-names.js +203 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/bundle.d.ts +3 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/bundle.js +73 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/contributions.d.ts +5 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/contributions.js +60 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/icon-names.generated.d.ts +1 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/icon-names.generated.js +2052 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/icons.d.ts +2 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/icons.js +51 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/index.d.ts +8 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/index.js +7 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/label-languages.d.ts +17 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/label-languages.js +119 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/limits.d.ts +14 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/limits.js +21 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/locales.d.ts +5 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/locales.js +148 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/package-files.d.ts +5 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/package-files.js +76 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/registry.d.ts +22 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/registry.js +133 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/sample-content.d.ts +3 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/sample-content.js +90 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/support.d.ts +24 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/support.js +55 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/templates.d.ts +6 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/templates.js +158 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/types.d.ts +53 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/types.js +1 -0
- package/node_modules/@kardalum/plugin-package/dist/docs-contract.d.ts +3 -2
- package/node_modules/@kardalum/plugin-package/dist/docs-contract.js +4 -2
- package/node_modules/@kardalum/plugin-package/dist/extract.d.ts +92 -3
- package/node_modules/@kardalum/plugin-package/dist/extract.js +251 -41
- package/node_modules/@kardalum/plugin-package/dist/index.d.ts +9 -2
- package/node_modules/@kardalum/plugin-package/dist/index.js +7 -2
- package/node_modules/@kardalum/plugin-package/dist/manifest-entry.d.ts +5 -0
- package/node_modules/@kardalum/plugin-package/dist/manifest-entry.js +20 -0
- package/node_modules/@kardalum/plugin-package/dist/reference-entry.d.ts +1 -0
- package/node_modules/@kardalum/plugin-package/dist/reference-entry.js +1 -0
- package/node_modules/@kardalum/plugin-package/dist/sample-content.d.ts +21 -3
- package/node_modules/@kardalum/plugin-package/dist/sample-content.js +37 -9
- package/node_modules/@kardalum/plugin-package/dist/shipped-files.d.ts +39 -0
- package/node_modules/@kardalum/plugin-package/dist/shipped-files.js +133 -0
- package/node_modules/@kardalum/plugin-package/dist/shipped-locales.d.ts +7 -0
- package/node_modules/@kardalum/plugin-package/dist/shipped-locales.js +27 -0
- package/node_modules/@kardalum/plugin-package/package.json +4 -2
- package/node_modules/@kardalum/ui/dist/components/dropdown-menu.js +2 -2
- package/node_modules/@kardalum/ui/package.json +1 -1
- package/package.json +6 -6
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import { lstatSync, readdirSync } from "node:fs";
|
|
2
|
+
import { join } from "node:path";
|
|
3
|
+
// S311 fix wave (W1): what a plugin's own folders put into its package, defined
|
|
4
|
+
// once. The CLI's build copies templates/, public/ and media/ through
|
|
5
|
+
// walkShipped, and every check that asks whether a declared file is there (a
|
|
6
|
+
// template, an asset, a sample's media file) asks whyNotShipped, at both gates.
|
|
7
|
+
// Before this the copy left out links and the folders below while the checks
|
|
8
|
+
// asked existsSync, which follows a link and sees those folders: a declared
|
|
9
|
+
// `dist/theme.css` passed `validate`, `build` and `pack`, and the marketplace
|
|
10
|
+
// then refused the package because the file was not in it.
|
|
11
|
+
/** Names a package never carries, at any depth, a folder with everything under
|
|
12
|
+
* it: vendored and build folders, and env files (they can hold live secrets),
|
|
13
|
+
* `.env.example` excepted (placeholder values a reader copies). A bare file
|
|
14
|
+
* of one of these names is left out too. */
|
|
15
|
+
export const EXCLUDED_NAMES = ["node_modules", "dist", ".git", ".next", ".astro"];
|
|
16
|
+
const EXCLUDED = new Set(EXCLUDED_NAMES);
|
|
17
|
+
const ENV_FILE = /^\.env(\..*)?$/;
|
|
18
|
+
/** How the rule reads in a message. */
|
|
19
|
+
const EXCLUDED_RULE = "node_modules, dist, .git, .next, .astro and env files are left out of the build";
|
|
20
|
+
const LINK_RULE = "the build copies files and folders, never links";
|
|
21
|
+
export function isExcludedSegment(segment) {
|
|
22
|
+
return EXCLUDED.has(segment) || (ENV_FILE.test(segment) && segment !== ".env.example");
|
|
23
|
+
}
|
|
24
|
+
function lstatOrNull(path) {
|
|
25
|
+
try {
|
|
26
|
+
return lstatSync(path);
|
|
27
|
+
}
|
|
28
|
+
catch {
|
|
29
|
+
return null;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
/** Every file and folder under `folder` that ships, parents before children,
|
|
33
|
+
* each folder's entries in name order. A link is never followed and never
|
|
34
|
+
* listed, a left-out name is skipped with everything under it, and a folder
|
|
35
|
+
* that is absent, a file or a link ships nothing. Iterative, so a deep tree
|
|
36
|
+
* costs no stack. */
|
|
37
|
+
export function walkShipped(folder) {
|
|
38
|
+
if (!lstatOrNull(folder)?.isDirectory())
|
|
39
|
+
return [];
|
|
40
|
+
const shipped = [];
|
|
41
|
+
// A queue read by index: every folder is read once, in the order it was found.
|
|
42
|
+
const pending = [""];
|
|
43
|
+
for (let next = 0; next < pending.length; next++) {
|
|
44
|
+
const relative = pending[next];
|
|
45
|
+
const children = readdirSync(relative === "" ? folder : join(folder, ...relative.split("/")), { withFileTypes: true })
|
|
46
|
+
.filter((entry) => !entry.isSymbolicLink() && !isExcludedSegment(entry.name) && (entry.isDirectory() || entry.isFile()))
|
|
47
|
+
.sort((a, b) => (a.name < b.name ? -1 : a.name > b.name ? 1 : 0));
|
|
48
|
+
if (relative !== "")
|
|
49
|
+
shipped.push({ path: relative, isDirectory: true, empty: children.length === 0 });
|
|
50
|
+
for (const child of children) {
|
|
51
|
+
const path = relative === "" ? child.name : `${relative}/${child.name}`;
|
|
52
|
+
if (child.isDirectory())
|
|
53
|
+
pending.push(path);
|
|
54
|
+
else
|
|
55
|
+
shipped.push({ path, isDirectory: false, empty: false });
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
return shipped;
|
|
59
|
+
}
|
|
60
|
+
const CASE_RULE = "names are matched exactly, as the marketplace and a Linux install read them";
|
|
61
|
+
/** Why a file is not one the build carries into the package, for any number
|
|
62
|
+
* of paths under one package root, each folder read once (S311 second code
|
|
63
|
+
* fix). A path is relative to `root`, with "/"; the answer is null for a
|
|
64
|
+
* regular file reached through real folders only, none of them a left-out
|
|
65
|
+
* name, or the reason, which reads after the path: "public/dist/theme.css is
|
|
66
|
+
* inside public/dist/, which ...".
|
|
67
|
+
*
|
|
68
|
+
* The first segment is the folder the build opens by its own name
|
|
69
|
+
* (templates, public or media), which a case-insensitive host resolves in any
|
|
70
|
+
* case, as the build's copy does, and writes into the package under that
|
|
71
|
+
* name. Every segment below it must be spelled as its folder lists it: the
|
|
72
|
+
* build copies the names it reads, so on Windows or macOS a declared
|
|
73
|
+
* `Styles/Site.css` the file system would find as `styles/site.css` is not in
|
|
74
|
+
* the package under the declared name, and the marketplace (and any Linux
|
|
75
|
+
* install) reads names exactly. */
|
|
76
|
+
export function createShippedLookup(root) {
|
|
77
|
+
const listings = new Map();
|
|
78
|
+
const namesIn = (folder) => {
|
|
79
|
+
if (listings.has(folder))
|
|
80
|
+
return listings.get(folder);
|
|
81
|
+
let names = null;
|
|
82
|
+
try {
|
|
83
|
+
const listed = readdirSync(folder);
|
|
84
|
+
names = { exact: new Set(listed), folded: new Map(listed.map((name) => [name.toLowerCase(), name])) };
|
|
85
|
+
}
|
|
86
|
+
catch {
|
|
87
|
+
// Not a folder that can be read: the lstat below says what it is.
|
|
88
|
+
}
|
|
89
|
+
listings.set(folder, names);
|
|
90
|
+
return names;
|
|
91
|
+
};
|
|
92
|
+
return (path) => {
|
|
93
|
+
const segments = path.split("/");
|
|
94
|
+
if (segments.some((segment) => segment === "" || segment === "." || segment === ".."))
|
|
95
|
+
return "is not a path inside the package";
|
|
96
|
+
let current = root;
|
|
97
|
+
for (let i = 0; i < segments.length; i++) {
|
|
98
|
+
const segment = segments[i];
|
|
99
|
+
const last = i === segments.length - 1;
|
|
100
|
+
const folder = `${segments.slice(0, i + 1).join("/")}/`;
|
|
101
|
+
if (isExcludedSegment(segment)) {
|
|
102
|
+
return last ? `is a name a package never carries: ${EXCLUDED_RULE}` : `is inside ${folder}, which a package never carries: ${EXCLUDED_RULE}`;
|
|
103
|
+
}
|
|
104
|
+
if (i > 0) {
|
|
105
|
+
const names = namesIn(current);
|
|
106
|
+
if (names !== null && !names.exact.has(segment)) {
|
|
107
|
+
const held = names.folded.get(segment.toLowerCase());
|
|
108
|
+
if (held === undefined)
|
|
109
|
+
return "does not exist";
|
|
110
|
+
return `differs in case from ${[...segments.slice(0, i), held].join("/")}, the name the folder holds: ${CASE_RULE}`;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
current = join(current, segment);
|
|
114
|
+
const stats = lstatOrNull(current);
|
|
115
|
+
if (stats === null)
|
|
116
|
+
return "does not exist";
|
|
117
|
+
if (stats.isSymbolicLink())
|
|
118
|
+
return last ? `is a link: ${LINK_RULE}` : `is inside ${folder}, a link: ${LINK_RULE}`;
|
|
119
|
+
if (!last && !stats.isDirectory())
|
|
120
|
+
return "does not exist";
|
|
121
|
+
if (last && stats.isDirectory())
|
|
122
|
+
return "is a folder, not a file";
|
|
123
|
+
if (last && !stats.isFile())
|
|
124
|
+
return "is not a regular file";
|
|
125
|
+
}
|
|
126
|
+
return null;
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
/** createShippedLookup's answer for one path. A caller with many paths under
|
|
130
|
+
* one root makes one lookup and asks it each. */
|
|
131
|
+
export function whyNotShipped(root, path) {
|
|
132
|
+
return createShippedLookup(root)(path);
|
|
133
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/** At most this many codes are read from one package's locales/ folder. */
|
|
2
|
+
export declare const MAX_SHIPPED_LOCALES = 100;
|
|
3
|
+
/** S314c2 (D9): the language codes of the locale files a package (or a plugin project) ships,
|
|
4
|
+
* locales/<code>.json, by file name alone (the admin parses each file when it loads it), sorted
|
|
5
|
+
* and at most MAX_SHIPPED_LOCALES. Never throws: no folder ships none. The registry row keeps
|
|
6
|
+
* them, so the admin asks only for files that exist. */
|
|
7
|
+
export declare function readShippedLocales(dir: string): string[];
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { readdirSync } from "node:fs";
|
|
2
|
+
import { join } from "node:path";
|
|
3
|
+
import { pluginLocaleFileLanguage } from "@kardalum/api-schemas";
|
|
4
|
+
/** At most this many codes are read from one package's locales/ folder. */
|
|
5
|
+
export const MAX_SHIPPED_LOCALES = 100;
|
|
6
|
+
/** S314c2 (D9): the language codes of the locale files a package (or a plugin project) ships,
|
|
7
|
+
* locales/<code>.json, by file name alone (the admin parses each file when it loads it), sorted
|
|
8
|
+
* and at most MAX_SHIPPED_LOCALES. Never throws: no folder ships none. The registry row keeps
|
|
9
|
+
* them, so the admin asks only for files that exist. */
|
|
10
|
+
export function readShippedLocales(dir) {
|
|
11
|
+
let names;
|
|
12
|
+
try {
|
|
13
|
+
names = readdirSync(join(dir, "locales"));
|
|
14
|
+
}
|
|
15
|
+
catch {
|
|
16
|
+
return [];
|
|
17
|
+
}
|
|
18
|
+
const codes = [];
|
|
19
|
+
for (const name of names.sort()) {
|
|
20
|
+
const code = pluginLocaleFileLanguage(name);
|
|
21
|
+
if (code !== null && !codes.includes(code))
|
|
22
|
+
codes.push(code);
|
|
23
|
+
if (codes.length >= MAX_SHIPPED_LOCALES)
|
|
24
|
+
break;
|
|
25
|
+
}
|
|
26
|
+
return codes;
|
|
27
|
+
}
|
|
@@ -41,14 +41,16 @@
|
|
|
41
41
|
"@types/node": "22.20.1",
|
|
42
42
|
"@types/yauzl": "^3.4.0",
|
|
43
43
|
"@types/yazl": "^3.3.1",
|
|
44
|
+
"lucide-react": "1.38.0",
|
|
44
45
|
"typescript": "6.0.3",
|
|
45
|
-
"vitest": "
|
|
46
|
+
"vitest": "4.1.12",
|
|
46
47
|
"yauzl": "3.4.0",
|
|
47
48
|
"yazl": "^3.3.1",
|
|
48
49
|
"@kardalum/api-schemas": "0.14.0"
|
|
49
50
|
},
|
|
50
51
|
"scripts": {
|
|
51
52
|
"build": "node -e \"require('fs').rmSync('dist',{recursive:true,force:true})\" && tsc -p .",
|
|
52
|
-
"test": "vitest run"
|
|
53
|
+
"test": "vitest run",
|
|
54
|
+
"generate:icon-names": "node scripts/generate-icon-names.mjs"
|
|
53
55
|
}
|
|
54
56
|
}
|
|
@@ -40,12 +40,12 @@ function DropdownMenuContent({ className, sideOffset = 4, ...props }) {
|
|
|
40
40
|
return (_jsx(DropdownMenuPrimitive.Portal, { children: _jsx(DropdownMenuPrimitive.Content, { sideOffset: sideOffset, className: cn('z-50 min-w-[10rem] overflow-hidden rounded-lg border border-border-default bg-background-elevated p-1 text-text-primary shadow-lg', className), ...props }) }));
|
|
41
41
|
}
|
|
42
42
|
function DropdownMenuItem({ className, inset, variant = 'default', ...props }) {
|
|
43
|
-
return (_jsx(DropdownMenuPrimitive.Item, { className: cn('relative flex cursor-pointer select-none items-center gap-2 rounded-sm px-2 py-1
|
|
43
|
+
return (_jsx(DropdownMenuPrimitive.Item, { className: cn('relative flex cursor-pointer select-none items-center gap-2 rounded-sm px-2 py-1 text-sm outline-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50', variant === 'destructive'
|
|
44
44
|
? 'text-danger-600 data-[highlighted]:bg-danger-100 data-[highlighted]:text-danger-700'
|
|
45
45
|
: 'text-text-primary data-[highlighted]:bg-background-hover', inset && 'ps-8', className), ...props }));
|
|
46
46
|
}
|
|
47
47
|
function DropdownMenuLabel({ className, inset, ...props }) {
|
|
48
|
-
return (_jsx(DropdownMenuPrimitive.Label, { className: cn('px-2 py-1
|
|
48
|
+
return (_jsx(DropdownMenuPrimitive.Label, { className: cn('px-2 py-1 text-xs font-semibold text-text-secondary', inset && 'ps-8', className), ...props }));
|
|
49
49
|
}
|
|
50
50
|
function DropdownMenuSeparator({ className, ...props }) {
|
|
51
51
|
return (_jsx(DropdownMenuPrimitive.Separator, { className: cn('-mx-1 my-1 h-px bg-border-default', className), ...props }));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kardalum/plugin-sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.17.0",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"description": "The SDK for building Kardalum plugins: manifest declaration, data type and admin section registries, storage-value providers, and shared UI components.",
|
|
6
6
|
"engines": {
|
|
@@ -113,11 +113,11 @@
|
|
|
113
113
|
"lucide-react": "1.38.0",
|
|
114
114
|
"tailwind-merge": "3.6.0",
|
|
115
115
|
"yauzl": "3.4.0",
|
|
116
|
-
"zod": "4.
|
|
117
|
-
"@kardalum/api-schemas": "0.14.0",
|
|
118
|
-
"@kardalum/design-tokens": "0.14.0",
|
|
116
|
+
"zod": "4.6.6",
|
|
119
117
|
"@kardalum/plugin-package": "0.14.0",
|
|
120
|
-
"@kardalum/ui": "0.14.0"
|
|
118
|
+
"@kardalum/ui": "0.14.0",
|
|
119
|
+
"@kardalum/api-schemas": "0.14.0",
|
|
120
|
+
"@kardalum/design-tokens": "0.14.0"
|
|
121
121
|
},
|
|
122
122
|
"peerDependencies": {
|
|
123
123
|
"react": "^19.0.0",
|
|
@@ -131,7 +131,7 @@
|
|
|
131
131
|
"react": "19.2.7",
|
|
132
132
|
"react-dom": "19.2.7",
|
|
133
133
|
"typescript": "6.0.3",
|
|
134
|
-
"vitest": "
|
|
134
|
+
"vitest": "4.1.12",
|
|
135
135
|
"@kardalum/test-utils": "0.0.0"
|
|
136
136
|
},
|
|
137
137
|
"scripts": {
|