@atscript/ui-styles 0.1.97 → 0.1.99

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/dist/index.cjs CHANGED
@@ -21,7 +21,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
21
21
  enumerable: true
22
22
  }) : target, mod));
23
23
  //#endregion
24
- const require_kebab = require("./kebab-DBLSvkJF.cjs");
24
+ const require_kebab = require("./kebab-DIhHuSSr.cjs");
25
25
  let _unocss_preset_icons = require("@unocss/preset-icons");
26
26
  _unocss_preset_icons = __toESM(_unocss_preset_icons);
27
27
  let vunor_theme = require("vunor/theme");
@@ -36,12 +36,9 @@ function createAsExtractor(opts = {}) {
36
36
  extract({ code }) {
37
37
  if (!code) return void 0;
38
38
  if (!code.includes("@atscript/") && !code.includes("<As") && !code.includes("<as-") && !helperNames.some((name) => code.includes(name))) return;
39
- const matched = /* @__PURE__ */ new Set();
39
+ const names = /* @__PURE__ */ new Set();
40
40
  const addClassesFor = (kebab) => {
41
- if (exclude.has(kebab)) return;
42
- const list = require_kebab.componentClasses[kebab];
43
- if (!list) return;
44
- for (const cls of list) matched.add(cls);
41
+ names.add(kebab);
45
42
  };
46
43
  for (const [, name] of code.matchAll(/['"]@atscript\/(?:vue-form|vue-table|vue-wf|vue-aooth)\/(as-[\w-]+)['"]/g)) addClassesFor(name);
47
44
  for (const [, names] of code.matchAll(/import\s*(?:type\s*)?\{([^}]+)\}\s*from\s*['"]@atscript\/(?:vue-form|vue-table|vue-wf|vue-aooth)['"]/g)) for (const ident of names.split(",")) {
@@ -50,6 +47,7 @@ function createAsExtractor(opts = {}) {
50
47
  }
51
48
  for (const [, name] of code.matchAll(/<(as-[\w-]+|As[A-Z][\w]*)/g)) addClassesFor(name.startsWith("As") ? require_kebab.kebabize(name) : name);
52
49
  if (helperPattern) for (const [, helper] of code.matchAll(helperPattern)) for (const kebab of require_kebab.helperAliases[helper] ?? []) addClassesFor(kebab);
50
+ const matched = require_kebab.expandComponentClasses([...names], require_kebab.componentClasses, require_kebab.componentCompanions, exclude);
53
51
  return matched.size > 0 ? matched : void 0;
54
52
  }
55
53
  };
@@ -1608,9 +1606,11 @@ exports.asWindowTableShortcuts = asWindowTableShortcuts;
1608
1606
  exports.bakedIcons = bakedIcons;
1609
1607
  exports.commonShortcuts = commonShortcuts;
1610
1608
  exports.componentClasses = require_kebab.componentClasses;
1609
+ exports.componentCompanions = require_kebab.componentCompanions;
1611
1610
  exports.componentPackages = require_kebab.componentPackages;
1612
1611
  exports.createAsBaseUnoConfig = createAsBaseUnoConfig;
1613
1612
  exports.createAsExtractor = createAsExtractor;
1613
+ exports.defaultAsVunorOptions = defaultAsVunorOptions;
1614
1614
  Object.defineProperty(exports, "defineShortcuts", {
1615
1615
  enumerable: true,
1616
1616
  get: function() {
package/dist/index.d.cts CHANGED
@@ -2,14 +2,44 @@ import { Extractor, Preset } from "unocss";
2
2
  import * as vunor_theme0 from "vunor/theme";
3
3
  import { TVunorShortcut, defineShortcuts, mergeVunorShortcuts, presetVunor, toUnoShortcut } from "vunor/theme";
4
4
 
5
+ //#region src/generated/component-classes.d.ts
6
+ /**
7
+ * Union of every published kebab-case component name, generated from the
8
+ * public component set. Powers autocomplete (and typo rejection) on knobs
9
+ * like `excludeComponents`.
10
+ */
11
+ type AsComponentName = "as-action" | "as-action-form-dialog" | "as-array" | "as-cell-array" | "as-cell-date" | "as-cell-json" | "as-cell-number" | "as-cell-union" | "as-checkbox" | "as-collapsible" | "as-column-menu" | "as-config-dialog" | "as-confirm-dialog" | "as-consent-array" | "as-copy" | "as-date" | "as-datetime" | "as-decimal" | "as-field" | "as-field-shell" | "as-filter-dialog" | "as-filter-field" | "as-filter-input" | "as-filters" | "as-form" | "as-input" | "as-iterator" | "as-multi-select" | "as-number" | "as-object" | "as-paragraph" | "as-password-rules" | "as-preset-dialog" | "as-preset-picker" | "as-qr-code" | "as-radio" | "as-ref" | "as-row-actions" | "as-select" | "as-sso-providers" | "as-table" | "as-table-actions" | "as-table-cell-value" | "as-table-header-cell" | "as-table-root" | "as-time" | "as-tuple" | "as-union" | "as-wf-finish" | "as-wf-form" | "as-window-table";
12
+ declare const componentClasses: Record<string, readonly string[]>;
13
+ declare const componentCompanions: Readonly<Partial<Record<AsComponentName, readonly AsComponentName[]>>>;
14
+ declare const helperAliases: Record<string, readonly AsComponentName[]>;
15
+ declare const componentPackages: Record<string, "form" | "table" | "wf" | "aooth">;
16
+ /**
17
+ * Own classes + transitively expanded companions for the given components.
18
+ * An excluded name contributes nothing and is not traversed through —
19
+ * see expandComponentClasses for the exact semantics.
20
+ */
21
+ declare function getComponentClasses(names: readonly string[], exclude?: ReadonlySet<string>): string[];
22
+ declare function getHelperClasses(...helpers: string[]): string[];
23
+ //#endregion
5
24
  //#region src/extractor.d.ts
6
25
  interface AsExtractorOptions {
7
26
  /**
8
27
  * Kebab-case component names whose classes should NEVER be added to the
9
28
  * safelist, even when the extractor matches them. Use to drop styles for
10
29
  * default components the consumer has replaced with their own implementation.
30
+ *
31
+ * Typed against {@link AsComponentName} — a union generated from the
32
+ * published component set — so editors autocomplete the names and typos
33
+ * fail the build instead of silently no-opping.
34
+ *
35
+ * Companions are veto-able too: components a matched component pulls in
36
+ * (statically or lazily — see `componentCompanions`) are expanded
37
+ * per-component, so excluding e.g. `as-config-dialog` / `as-filter-dialog` /
38
+ * `as-preset-dialog` sheds those dialogs' CSS even when you only tag
39
+ * `<AsTableRoot>` — useful when the app never opens them or supplies its
40
+ * own implementations.
11
41
  */
12
- excludeComponents?: string[];
42
+ excludeComponents?: AsComponentName[];
13
43
  }
14
44
  declare function createAsExtractor(opts?: AsExtractorOptions): Extractor;
15
45
  //#endregion
@@ -19,6 +49,33 @@ declare function createAsExtractor(opts?: AsExtractorOptions): Extractor;
19
49
  * their own theme overrides without reaching into `vunor/theme` themselves.
20
50
  */
21
51
  type AsVunorPresetOptions = NonNullable<Parameters<typeof presetVunor>[0]>;
52
+ /**
53
+ * Baked-in vunor theme defaults atscript-ui has shipped since day one.
54
+ * Any field a consumer omits from `asPresetVunor({ vunor: ... })` falls
55
+ * back to the value here. Exported so consumers can read the defaults
56
+ * if they want to extend (rather than replace) a nested map.
57
+ */
58
+ declare const defaultAsVunorOptions: {
59
+ readonly baseRadius: "4px";
60
+ readonly fingertip: {
61
+ readonly xs: "1.5em";
62
+ readonly s: "2.15em";
63
+ readonly m: "2.6em";
64
+ readonly l: "2.9em";
65
+ readonly xl: "3.25em";
66
+ };
67
+ readonly palette: {
68
+ readonly colors: {
69
+ readonly primary: "#2563eb";
70
+ readonly grey: "#64748b";
71
+ readonly neutral: "#475569";
72
+ readonly error: "#dc2626";
73
+ };
74
+ readonly lightest: 0.97;
75
+ readonly darkest: 0.22;
76
+ readonly layersDepth: 0.08;
77
+ };
78
+ };
22
79
  /**
23
80
  * Full `presetVunor()` theme options. Every field is optional and merged on
24
81
  * top of the baked atscript-ui defaults (`defaultAsVunorOptions`):
@@ -34,9 +91,18 @@ interface AsPresetVunorOptions extends AsBaseUnoConfigOptions {
34
91
  * Kebab-case component names whose classes the extractor should drop from
35
92
  * the safelist (post-match). Use when the consumer has replaced a built-in
36
93
  * default with their own implementation and wants to shed the unused styles.
94
+ *
95
+ * Typed against {@link AsComponentName} — a union generated from the
96
+ * published component set — so editors autocomplete the names and typos
97
+ * fail the build instead of silently no-opping.
98
+ *
99
+ * Also applies to companions — components a matched component pulls in
100
+ * (statically or lazily). E.g. excluding `as-config-dialog` /
101
+ * `as-filter-dialog` / `as-preset-dialog` sheds those dialogs' CSS for
102
+ * apps that mount `<AsTableRoot>` but never open them or supply their own.
37
103
  * See STYLES.md Decision 15.
38
104
  */
39
- excludeComponents?: string[];
105
+ excludeComponents?: AsComponentName[];
40
106
  /**
41
107
  * Replace any of our built-in `i-as-<name>` icons with custom SVG strings.
42
108
  * Keys are the semantic names listed in `bakedIcons` (e.g. `search`,
@@ -281,14 +347,7 @@ declare const wfShortcuts: vunor_theme0.TVunorShortcut;
281
347
  //#region src/shortcuts/index.d.ts
282
348
  declare const allShortcuts: vunor_theme0.TVunorShortcut;
283
349
  //#endregion
284
- //#region src/generated/component-classes.d.ts
285
- declare const componentClasses: Record<string, readonly string[]>;
286
- declare const helperAliases: Record<string, readonly string[]>;
287
- declare const componentPackages: Record<string, "form" | "table" | "wf" | "aooth">;
288
- declare function getComponentClasses(...names: string[]): string[];
289
- declare function getHelperClasses(...helpers: string[]): string[];
290
- //#endregion
291
350
  //#region src/generated/baked-icons.d.ts
292
351
  declare const bakedIcons: Record<string, string>;
293
352
  //#endregion
294
- export { type AsBaseUnoConfigOptions, type AsExtractorOptions, type AsPresetVunorOptions, type TVunorShortcut, allShortcuts, aoothShortcuts, asActionFormShortcuts, asActionShortcuts, asArrayShortcuts, asCellShortcuts, asCheckboxRadioShortcuts, asCollapsibleShortcuts, asColumnMenuShortcuts, asConfigDialogShortcuts, asConfigTabShortcuts, asConfirmDialogShortcuts, asConsentArrayShortcuts, asCopyShortcuts, asDecimalNumberShortcuts, asDropdownShortcuts, asFieldShortcuts, asFilterDialogShortcuts, asFilterFieldShortcuts, asFormGridShortcuts, asFormShortcuts, asFpillShortcuts, asMultiSelectShortcuts, asNoDataShortcuts, asObjectShortcuts, asOrderableListShortcuts, asPageShortcuts, asPasswordRulesShortcuts, asPresetDialogShortcuts, asPresetPickerShortcuts, asPresetVunor, asQrCodeShortcuts, asRefShortcuts, asRowActionsShortcuts, asSorterShortcuts, asSsoProvidersShortcuts, asTableActionsShortcuts, asTableShortcuts, asWfFinishActionsShortcuts, asWfFinishCountdownShortcuts, asWfFinishMessageShortcuts, asWfFinishOptionShortcuts, asWfFinishPrimaryShortcuts, asWfFinishShortcuts, asWfFinishSkipShortcuts, asWfFormLoadingShortcuts, asWfFormShortcuts, asWindowScrollbarShortcuts, asWindowSkeletonShortcuts, asWindowTableShortcuts, bakedIcons, commonShortcuts, componentClasses, componentPackages, createAsBaseUnoConfig, createAsExtractor, defineShortcuts, formShortcuts, getComponentClasses, getHelperClasses, helperAliases, mergeVunorShortcuts, tableShortcuts, toUnoShortcut, wfShortcuts };
353
+ export { type AsBaseUnoConfigOptions, type AsComponentName, type AsExtractorOptions, type AsPresetVunorOptions, type TVunorShortcut, allShortcuts, aoothShortcuts, asActionFormShortcuts, asActionShortcuts, asArrayShortcuts, asCellShortcuts, asCheckboxRadioShortcuts, asCollapsibleShortcuts, asColumnMenuShortcuts, asConfigDialogShortcuts, asConfigTabShortcuts, asConfirmDialogShortcuts, asConsentArrayShortcuts, asCopyShortcuts, asDecimalNumberShortcuts, asDropdownShortcuts, asFieldShortcuts, asFilterDialogShortcuts, asFilterFieldShortcuts, asFormGridShortcuts, asFormShortcuts, asFpillShortcuts, asMultiSelectShortcuts, asNoDataShortcuts, asObjectShortcuts, asOrderableListShortcuts, asPageShortcuts, asPasswordRulesShortcuts, asPresetDialogShortcuts, asPresetPickerShortcuts, asPresetVunor, asQrCodeShortcuts, asRefShortcuts, asRowActionsShortcuts, asSorterShortcuts, asSsoProvidersShortcuts, asTableActionsShortcuts, asTableShortcuts, asWfFinishActionsShortcuts, asWfFinishCountdownShortcuts, asWfFinishMessageShortcuts, asWfFinishOptionShortcuts, asWfFinishPrimaryShortcuts, asWfFinishShortcuts, asWfFinishSkipShortcuts, asWfFormLoadingShortcuts, asWfFormShortcuts, asWindowScrollbarShortcuts, asWindowSkeletonShortcuts, asWindowTableShortcuts, bakedIcons, commonShortcuts, componentClasses, componentCompanions, componentPackages, createAsBaseUnoConfig, createAsExtractor, defaultAsVunorOptions, defineShortcuts, formShortcuts, getComponentClasses, getHelperClasses, helperAliases, mergeVunorShortcuts, tableShortcuts, toUnoShortcut, wfShortcuts };
package/dist/index.d.mts CHANGED
@@ -2,14 +2,44 @@ import * as vunor_theme0 from "vunor/theme";
2
2
  import { TVunorShortcut, defineShortcuts, mergeVunorShortcuts, presetVunor, toUnoShortcut } from "vunor/theme";
3
3
  import { Extractor, Preset } from "unocss";
4
4
 
5
+ //#region src/generated/component-classes.d.ts
6
+ /**
7
+ * Union of every published kebab-case component name, generated from the
8
+ * public component set. Powers autocomplete (and typo rejection) on knobs
9
+ * like `excludeComponents`.
10
+ */
11
+ type AsComponentName = "as-action" | "as-action-form-dialog" | "as-array" | "as-cell-array" | "as-cell-date" | "as-cell-json" | "as-cell-number" | "as-cell-union" | "as-checkbox" | "as-collapsible" | "as-column-menu" | "as-config-dialog" | "as-confirm-dialog" | "as-consent-array" | "as-copy" | "as-date" | "as-datetime" | "as-decimal" | "as-field" | "as-field-shell" | "as-filter-dialog" | "as-filter-field" | "as-filter-input" | "as-filters" | "as-form" | "as-input" | "as-iterator" | "as-multi-select" | "as-number" | "as-object" | "as-paragraph" | "as-password-rules" | "as-preset-dialog" | "as-preset-picker" | "as-qr-code" | "as-radio" | "as-ref" | "as-row-actions" | "as-select" | "as-sso-providers" | "as-table" | "as-table-actions" | "as-table-cell-value" | "as-table-header-cell" | "as-table-root" | "as-time" | "as-tuple" | "as-union" | "as-wf-finish" | "as-wf-form" | "as-window-table";
12
+ declare const componentClasses: Record<string, readonly string[]>;
13
+ declare const componentCompanions: Readonly<Partial<Record<AsComponentName, readonly AsComponentName[]>>>;
14
+ declare const helperAliases: Record<string, readonly AsComponentName[]>;
15
+ declare const componentPackages: Record<string, "form" | "table" | "wf" | "aooth">;
16
+ /**
17
+ * Own classes + transitively expanded companions for the given components.
18
+ * An excluded name contributes nothing and is not traversed through —
19
+ * see expandComponentClasses for the exact semantics.
20
+ */
21
+ declare function getComponentClasses(names: readonly string[], exclude?: ReadonlySet<string>): string[];
22
+ declare function getHelperClasses(...helpers: string[]): string[];
23
+ //#endregion
5
24
  //#region src/extractor.d.ts
6
25
  interface AsExtractorOptions {
7
26
  /**
8
27
  * Kebab-case component names whose classes should NEVER be added to the
9
28
  * safelist, even when the extractor matches them. Use to drop styles for
10
29
  * default components the consumer has replaced with their own implementation.
30
+ *
31
+ * Typed against {@link AsComponentName} — a union generated from the
32
+ * published component set — so editors autocomplete the names and typos
33
+ * fail the build instead of silently no-opping.
34
+ *
35
+ * Companions are veto-able too: components a matched component pulls in
36
+ * (statically or lazily — see `componentCompanions`) are expanded
37
+ * per-component, so excluding e.g. `as-config-dialog` / `as-filter-dialog` /
38
+ * `as-preset-dialog` sheds those dialogs' CSS even when you only tag
39
+ * `<AsTableRoot>` — useful when the app never opens them or supplies its
40
+ * own implementations.
11
41
  */
12
- excludeComponents?: string[];
42
+ excludeComponents?: AsComponentName[];
13
43
  }
14
44
  declare function createAsExtractor(opts?: AsExtractorOptions): Extractor;
15
45
  //#endregion
@@ -19,6 +49,33 @@ declare function createAsExtractor(opts?: AsExtractorOptions): Extractor;
19
49
  * their own theme overrides without reaching into `vunor/theme` themselves.
20
50
  */
21
51
  type AsVunorPresetOptions = NonNullable<Parameters<typeof presetVunor>[0]>;
52
+ /**
53
+ * Baked-in vunor theme defaults atscript-ui has shipped since day one.
54
+ * Any field a consumer omits from `asPresetVunor({ vunor: ... })` falls
55
+ * back to the value here. Exported so consumers can read the defaults
56
+ * if they want to extend (rather than replace) a nested map.
57
+ */
58
+ declare const defaultAsVunorOptions: {
59
+ readonly baseRadius: "4px";
60
+ readonly fingertip: {
61
+ readonly xs: "1.5em";
62
+ readonly s: "2.15em";
63
+ readonly m: "2.6em";
64
+ readonly l: "2.9em";
65
+ readonly xl: "3.25em";
66
+ };
67
+ readonly palette: {
68
+ readonly colors: {
69
+ readonly primary: "#2563eb";
70
+ readonly grey: "#64748b";
71
+ readonly neutral: "#475569";
72
+ readonly error: "#dc2626";
73
+ };
74
+ readonly lightest: 0.97;
75
+ readonly darkest: 0.22;
76
+ readonly layersDepth: 0.08;
77
+ };
78
+ };
22
79
  /**
23
80
  * Full `presetVunor()` theme options. Every field is optional and merged on
24
81
  * top of the baked atscript-ui defaults (`defaultAsVunorOptions`):
@@ -34,9 +91,18 @@ interface AsPresetVunorOptions extends AsBaseUnoConfigOptions {
34
91
  * Kebab-case component names whose classes the extractor should drop from
35
92
  * the safelist (post-match). Use when the consumer has replaced a built-in
36
93
  * default with their own implementation and wants to shed the unused styles.
94
+ *
95
+ * Typed against {@link AsComponentName} — a union generated from the
96
+ * published component set — so editors autocomplete the names and typos
97
+ * fail the build instead of silently no-opping.
98
+ *
99
+ * Also applies to companions — components a matched component pulls in
100
+ * (statically or lazily). E.g. excluding `as-config-dialog` /
101
+ * `as-filter-dialog` / `as-preset-dialog` sheds those dialogs' CSS for
102
+ * apps that mount `<AsTableRoot>` but never open them or supply their own.
37
103
  * See STYLES.md Decision 15.
38
104
  */
39
- excludeComponents?: string[];
105
+ excludeComponents?: AsComponentName[];
40
106
  /**
41
107
  * Replace any of our built-in `i-as-<name>` icons with custom SVG strings.
42
108
  * Keys are the semantic names listed in `bakedIcons` (e.g. `search`,
@@ -281,14 +347,7 @@ declare const wfShortcuts: vunor_theme0.TVunorShortcut;
281
347
  //#region src/shortcuts/index.d.ts
282
348
  declare const allShortcuts: vunor_theme0.TVunorShortcut;
283
349
  //#endregion
284
- //#region src/generated/component-classes.d.ts
285
- declare const componentClasses: Record<string, readonly string[]>;
286
- declare const helperAliases: Record<string, readonly string[]>;
287
- declare const componentPackages: Record<string, "form" | "table" | "wf" | "aooth">;
288
- declare function getComponentClasses(...names: string[]): string[];
289
- declare function getHelperClasses(...helpers: string[]): string[];
290
- //#endregion
291
350
  //#region src/generated/baked-icons.d.ts
292
351
  declare const bakedIcons: Record<string, string>;
293
352
  //#endregion
294
- export { type AsBaseUnoConfigOptions, type AsExtractorOptions, type AsPresetVunorOptions, type TVunorShortcut, allShortcuts, aoothShortcuts, asActionFormShortcuts, asActionShortcuts, asArrayShortcuts, asCellShortcuts, asCheckboxRadioShortcuts, asCollapsibleShortcuts, asColumnMenuShortcuts, asConfigDialogShortcuts, asConfigTabShortcuts, asConfirmDialogShortcuts, asConsentArrayShortcuts, asCopyShortcuts, asDecimalNumberShortcuts, asDropdownShortcuts, asFieldShortcuts, asFilterDialogShortcuts, asFilterFieldShortcuts, asFormGridShortcuts, asFormShortcuts, asFpillShortcuts, asMultiSelectShortcuts, asNoDataShortcuts, asObjectShortcuts, asOrderableListShortcuts, asPageShortcuts, asPasswordRulesShortcuts, asPresetDialogShortcuts, asPresetPickerShortcuts, asPresetVunor, asQrCodeShortcuts, asRefShortcuts, asRowActionsShortcuts, asSorterShortcuts, asSsoProvidersShortcuts, asTableActionsShortcuts, asTableShortcuts, asWfFinishActionsShortcuts, asWfFinishCountdownShortcuts, asWfFinishMessageShortcuts, asWfFinishOptionShortcuts, asWfFinishPrimaryShortcuts, asWfFinishShortcuts, asWfFinishSkipShortcuts, asWfFormLoadingShortcuts, asWfFormShortcuts, asWindowScrollbarShortcuts, asWindowSkeletonShortcuts, asWindowTableShortcuts, bakedIcons, commonShortcuts, componentClasses, componentPackages, createAsBaseUnoConfig, createAsExtractor, defineShortcuts, formShortcuts, getComponentClasses, getHelperClasses, helperAliases, mergeVunorShortcuts, tableShortcuts, toUnoShortcut, wfShortcuts };
353
+ export { type AsBaseUnoConfigOptions, type AsComponentName, type AsExtractorOptions, type AsPresetVunorOptions, type TVunorShortcut, allShortcuts, aoothShortcuts, asActionFormShortcuts, asActionShortcuts, asArrayShortcuts, asCellShortcuts, asCheckboxRadioShortcuts, asCollapsibleShortcuts, asColumnMenuShortcuts, asConfigDialogShortcuts, asConfigTabShortcuts, asConfirmDialogShortcuts, asConsentArrayShortcuts, asCopyShortcuts, asDecimalNumberShortcuts, asDropdownShortcuts, asFieldShortcuts, asFilterDialogShortcuts, asFilterFieldShortcuts, asFormGridShortcuts, asFormShortcuts, asFpillShortcuts, asMultiSelectShortcuts, asNoDataShortcuts, asObjectShortcuts, asOrderableListShortcuts, asPageShortcuts, asPasswordRulesShortcuts, asPresetDialogShortcuts, asPresetPickerShortcuts, asPresetVunor, asQrCodeShortcuts, asRefShortcuts, asRowActionsShortcuts, asSorterShortcuts, asSsoProvidersShortcuts, asTableActionsShortcuts, asTableShortcuts, asWfFinishActionsShortcuts, asWfFinishCountdownShortcuts, asWfFinishMessageShortcuts, asWfFinishOptionShortcuts, asWfFinishPrimaryShortcuts, asWfFinishShortcuts, asWfFinishSkipShortcuts, asWfFormLoadingShortcuts, asWfFormShortcuts, asWindowScrollbarShortcuts, asWindowSkeletonShortcuts, asWindowTableShortcuts, bakedIcons, commonShortcuts, componentClasses, componentCompanions, componentPackages, createAsBaseUnoConfig, createAsExtractor, defaultAsVunorOptions, defineShortcuts, formShortcuts, getComponentClasses, getHelperClasses, helperAliases, mergeVunorShortcuts, tableShortcuts, toUnoShortcut, wfShortcuts };
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { a as getHelperClasses, i as getComponentClasses, n as componentClasses, o as helperAliases, r as componentPackages, t as kebabize } from "./kebab-CIOWFpN-.mjs";
1
+ import { a as getComponentClasses, i as componentPackages, l as expandComponentClasses, n as componentClasses, o as getHelperClasses, r as componentCompanions, s as helperAliases, t as kebabize } from "./kebab-BTLZj6qb.mjs";
2
2
  import presetIcons from "@unocss/preset-icons";
3
3
  import { defineShortcuts, defineShortcuts as defineShortcuts$1, mergeVunorShortcuts, mergeVunorShortcuts as mergeVunorShortcuts$1, presetVunor, toUnoShortcut, vunorShortcuts } from "vunor/theme";
4
4
  //#region src/extractor.ts
@@ -12,12 +12,9 @@ function createAsExtractor(opts = {}) {
12
12
  extract({ code }) {
13
13
  if (!code) return void 0;
14
14
  if (!code.includes("@atscript/") && !code.includes("<As") && !code.includes("<as-") && !helperNames.some((name) => code.includes(name))) return;
15
- const matched = /* @__PURE__ */ new Set();
15
+ const names = /* @__PURE__ */ new Set();
16
16
  const addClassesFor = (kebab) => {
17
- if (exclude.has(kebab)) return;
18
- const list = componentClasses[kebab];
19
- if (!list) return;
20
- for (const cls of list) matched.add(cls);
17
+ names.add(kebab);
21
18
  };
22
19
  for (const [, name] of code.matchAll(/['"]@atscript\/(?:vue-form|vue-table|vue-wf|vue-aooth)\/(as-[\w-]+)['"]/g)) addClassesFor(name);
23
20
  for (const [, names] of code.matchAll(/import\s*(?:type\s*)?\{([^}]+)\}\s*from\s*['"]@atscript\/(?:vue-form|vue-table|vue-wf|vue-aooth)['"]/g)) for (const ident of names.split(",")) {
@@ -26,6 +23,7 @@ function createAsExtractor(opts = {}) {
26
23
  }
27
24
  for (const [, name] of code.matchAll(/<(as-[\w-]+|As[A-Z][\w]*)/g)) addClassesFor(name.startsWith("As") ? kebabize(name) : name);
28
25
  if (helperPattern) for (const [, helper] of code.matchAll(helperPattern)) for (const kebab of helperAliases[helper] ?? []) addClassesFor(kebab);
26
+ const matched = expandComponentClasses([...names], componentClasses, componentCompanions, exclude);
29
27
  return matched.size > 0 ? matched : void 0;
30
28
  }
31
29
  };
@@ -1528,4 +1526,4 @@ function createAsBaseUnoConfig(options = {}) {
1528
1526
  };
1529
1527
  }
1530
1528
  //#endregion
1531
- export { allShortcuts, aoothShortcuts, asActionFormShortcuts, asActionShortcuts, asArrayShortcuts, asCellShortcuts, asCheckboxRadioShortcuts, asCollapsibleShortcuts, asColumnMenuShortcuts, asConfigDialogShortcuts, asConfigTabShortcuts, asConfirmDialogShortcuts, asConsentArrayShortcuts, asCopyShortcuts, asDecimalNumberShortcuts, asDropdownShortcuts, asFieldShortcuts, asFilterDialogShortcuts, asFilterFieldShortcuts, asFormGridShortcuts, asFormShortcuts, asFpillShortcuts, asMultiSelectShortcuts, asNoDataShortcuts, asObjectShortcuts, asOrderableListShortcuts, asPageShortcuts, asPasswordRulesShortcuts, asPresetDialogShortcuts, asPresetPickerShortcuts, asPresetVunor, asQrCodeShortcuts, asRefShortcuts, asRowActionsShortcuts, asSorterShortcuts, asSsoProvidersShortcuts, asTableActionsShortcuts, asTableShortcuts, asWfFinishActionsShortcuts, asWfFinishCountdownShortcuts, asWfFinishMessageShortcuts, asWfFinishOptionShortcuts, asWfFinishPrimaryShortcuts, asWfFinishShortcuts, asWfFinishSkipShortcuts, asWfFormLoadingShortcuts, asWfFormShortcuts, asWindowScrollbarShortcuts, asWindowSkeletonShortcuts, asWindowTableShortcuts, bakedIcons, commonShortcuts, componentClasses, componentPackages, createAsBaseUnoConfig, createAsExtractor, defineShortcuts, formShortcuts, getComponentClasses, getHelperClasses, helperAliases, mergeVunorShortcuts, tableShortcuts, toUnoShortcut, wfShortcuts };
1529
+ export { allShortcuts, aoothShortcuts, asActionFormShortcuts, asActionShortcuts, asArrayShortcuts, asCellShortcuts, asCheckboxRadioShortcuts, asCollapsibleShortcuts, asColumnMenuShortcuts, asConfigDialogShortcuts, asConfigTabShortcuts, asConfirmDialogShortcuts, asConsentArrayShortcuts, asCopyShortcuts, asDecimalNumberShortcuts, asDropdownShortcuts, asFieldShortcuts, asFilterDialogShortcuts, asFilterFieldShortcuts, asFormGridShortcuts, asFormShortcuts, asFpillShortcuts, asMultiSelectShortcuts, asNoDataShortcuts, asObjectShortcuts, asOrderableListShortcuts, asPageShortcuts, asPasswordRulesShortcuts, asPresetDialogShortcuts, asPresetPickerShortcuts, asPresetVunor, asQrCodeShortcuts, asRefShortcuts, asRowActionsShortcuts, asSorterShortcuts, asSsoProvidersShortcuts, asTableActionsShortcuts, asTableShortcuts, asWfFinishActionsShortcuts, asWfFinishCountdownShortcuts, asWfFinishMessageShortcuts, asWfFinishOptionShortcuts, asWfFinishPrimaryShortcuts, asWfFinishShortcuts, asWfFinishSkipShortcuts, asWfFormLoadingShortcuts, asWfFormShortcuts, asWindowScrollbarShortcuts, asWindowSkeletonShortcuts, asWindowTableShortcuts, bakedIcons, commonShortcuts, componentClasses, componentCompanions, componentPackages, createAsBaseUnoConfig, createAsExtractor, defaultAsVunorOptions, defineShortcuts, formShortcuts, getComponentClasses, getHelperClasses, helperAliases, mergeVunorShortcuts, tableShortcuts, toUnoShortcut, wfShortcuts };