vlite3 1.4.15 → 1.4.16

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.
@@ -22,8 +22,8 @@ import qe from "../IconPicker.vue.js";
22
22
  /* empty css */
23
23
  /* empty css */
24
24
  /* empty css */
25
- /* empty css */
26
- /* empty css */
25
+ /* empty css */
26
+ /* empty css */
27
27
  import "../../core/config.js";
28
28
  /* empty css */
29
29
  /* empty css */
@@ -4,7 +4,7 @@ import k from "../Icon.vue.js";
4
4
  import { $t as E } from "../../utils/i18n.js";
5
5
  import { useCommandPaletteItems as Y } from "./useCommandPaletteItems.js";
6
6
  import { useCommandPaletteNav as Z } from "./useCommandPaletteNav.js";
7
- import ee from "./CommandPaletteItem.vue2.js";
7
+ import ee from "./CommandPaletteItem.vue.js";
8
8
  const te = { class: "command-palette-content flex flex-col w-full h-full max-h-[70vh]" }, oe = { class: "flex items-center gap-3 px-4 py-3 border-b border-border/80 shrink-0" }, se = ["placeholder"], ne = ["aria-label"], re = {
9
9
  key: 0,
10
10
  class: "flex flex-col items-center justify-center py-14 px-6 text-center select-none",
@@ -1,5 +1,5 @@
1
1
  import t from "./CommandPaletteItem.vue3.js";
2
- /* empty css */
2
+ /* empty css */
3
3
  import o from "../../_virtual/_plugin-vue_export-helper.js";
4
4
  const r = /* @__PURE__ */ o(t, [["__scopeId", "data-v-66b1ae06"]]);
5
5
  export {
@@ -1,4 +1,4 @@
1
- import o from "./DropdownMenu.vue3.js";
1
+ import o from "./DropdownMenu.vue2.js";
2
2
  /* empty css */
3
3
  import r from "../../_virtual/_plugin-vue_export-helper.js";
4
4
  const m = /* @__PURE__ */ r(o, [["__scopeId", "data-v-173c7a02"]]);
@@ -3,7 +3,7 @@ import L from "./Icon.vue.js";
3
3
  import v from "./Modal.vue.js";
4
4
  import N from "./CommandPalette/CommandPaletteContent.vue.js";
5
5
  import { $t as U } from "../utils/i18n.js";
6
- /* empty css */
6
+ /* empty css */
7
7
  const V = { class: "block truncate -text-fs-1.5" }, S = { class: "ml-auto inline-flex items-center gap-0.5 px-1.5 py-0.5 rounded text-[10px] font-mono font-medium border border-border/80 bg-background text-muted-foreground ml-1" }, A = /* @__PURE__ */ x({
8
8
  __name: "NavbarCommandPalette",
9
9
  props: {
@@ -1,9 +1,9 @@
1
1
  import { defineComponent as te, ref as v, shallowRef as ne, watch as oe, computed as h, onMounted as le, onUnmounted as ae, openBlock as C, createElementBlock as L, normalizeClass as re, toDisplayString as I, createCommentVNode as U, createElementVNode as w, createVNode as q, unref as a, normalizeStyle as ie } from "vue";
2
2
  /* empty css */
3
- import se from "./RichTextToolbar.vue2.js";
4
- /* empty css */
5
- import de from "./RichTextLinkPopover.vue2.js";
6
- /* empty css */
3
+ import se from "./RichTextToolbar.vue.js";
4
+ /* empty css */
5
+ import de from "./RichTextLinkPopover.vue.js";
6
+ /* empty css */
7
7
  import { useRichTextImageUpload as ue } from "./composables/useRichTextImageUpload.js";
8
8
  import { useRichTextLinks as ce } from "./composables/useRichTextLinks.js";
9
9
  const fe = ["aria-labelledby", "aria-describedby"], me = ["id", "for"], ve = { class: "rte-wrapper" }, ye = { class: "rte-body-wrap" }, ge = ["id", "contenteditable", "aria-label", "aria-readonly", "aria-disabled", "aria-invalid"], be = ["id"], Se = /* @__PURE__ */ te({
@@ -1,5 +1,5 @@
1
- import o from "./RichTextLinkPopover.vue2.js";
2
- /* empty css */
1
+ import o from "./RichTextLinkPopover.vue.js";
2
+ /* empty css */
3
3
  export {
4
4
  o as default
5
5
  };
@@ -1,5 +1,5 @@
1
- import o from "./RichTextToolbar.vue2.js";
2
- /* empty css */
1
+ import o from "./RichTextToolbar.vue.js";
2
+ /* empty css */
3
3
  export {
4
4
  o as default
5
5
  };
@@ -21,8 +21,8 @@ import "iconify-icon-picker/style.css";
21
21
  /* empty css */
22
22
  /* empty css */
23
23
  /* empty css */
24
- /* empty css */
25
- /* empty css */
24
+ /* empty css */
25
+ /* empty css */
26
26
  import "../../core/config.js";
27
27
  /* empty css */
28
28
  /* empty css */
@@ -1,8 +1,8 @@
1
- import { defineComponent as m, useId as c, computed as o, provide as v, openBlock as i, createElementBlock as f, normalizeStyle as p, normalizeClass as C, createBlock as h, resolveDynamicComponent as y, withCtx as S, createTextVNode as b, toDisplayString as g, renderSlot as T } from "vue";
2
- import { buildThemeVariables as k, buildThemeStyleBlock as B, buildCardOverrideStyles as _ } from "./themeVars.js";
3
- import { THEME_STYLES_KEY as E } from "../../composables/useThemeStyles.js";
4
- import { isDarkColor as x } from "../../utils/colorUtils.js";
5
- const V = /* @__PURE__ */ m({
1
+ import { defineComponent as m, computed as o, provide as u, openBlock as a, createElementBlock as v, normalizeClass as c, createBlock as f, resolveDynamicComponent as p, withCtx as h, createTextVNode as C, toDisplayString as b, renderSlot as g } from "vue";
2
+ import { buildThemeVariables as S, buildThemeStyleBlock as y, buildCardOverrideStyles as T } from "./themeVars.js";
3
+ import { THEME_STYLES_KEY as k } from "../../composables/useThemeStyles.js";
4
+ import { isDarkColor as B } from "../../utils/colorUtils.js";
5
+ const P = /* @__PURE__ */ m({
6
6
  __name: "ThemeProvider",
7
7
  props: {
8
8
  bgColor: { default: void 0 },
@@ -14,35 +14,33 @@ const V = /* @__PURE__ */ m({
14
14
  maxWidth: { default: void 0 },
15
15
  rootClass: { default: void 0 }
16
16
  },
17
- setup(r) {
18
- const e = r, t = `vlite-theme-provider-${c()}`, a = o(() => e.bgColor ? x(e.bgColor) : !1), l = o(() => k(e)), d = o(
19
- () => B(l.value, t)
17
+ setup(t) {
18
+ const e = t, r = o(() => e.bgColor ? B(e.bgColor) : !1), l = o(() => S(e)), i = o(
19
+ () => y(l.value, ".vlite-theme-provider")
20
+ ), d = o(
21
+ () => e.bgColor ? T(e.bgColor, r.value, ".vlite-theme-provider") : ""
20
22
  ), s = o(
21
- () => e.bgColor ? _(e.bgColor, a.value, `#${t}`) : ""
22
- ), n = o(
23
- () => [d.value, s.value].filter(Boolean).join(`
23
+ () => [i.value, d.value].filter(Boolean).join(`
24
24
  `)
25
25
  );
26
- return v(E, l), (u, D) => (i(), f("div", {
27
- id: t,
28
- class: C([
26
+ return u(k, l), (n, _) => (a(), v("div", {
27
+ class: c([
29
28
  "vlite-theme-provider",
30
- r.rootClass,
29
+ t.rootClass,
31
30
  "transition-colors duration-300",
32
- { dark: a.value }
33
- ]),
34
- style: p(l.value)
31
+ { dark: r.value }
32
+ ])
35
33
  }, [
36
- (i(), h(y("style"), null, {
37
- default: S(() => [
38
- b(g(n.value), 1)
34
+ (a(), f(p("style"), null, {
35
+ default: h(() => [
36
+ C(b(s.value), 1)
39
37
  ]),
40
38
  _: 1
41
39
  })),
42
- T(u.$slots, "default")
43
- ], 6));
40
+ g(n.$slots, "default")
41
+ ], 2));
44
42
  }
45
43
  });
46
44
  export {
47
- V as default
45
+ P as default
48
46
  };
@@ -11,7 +11,7 @@ export declare const DEFAULT_MAX_WIDTH = 1440;
11
11
  export declare function buildCardOverrideStyles(bg: string, isDark: boolean, scope?: string): string;
12
12
  /**
13
13
  * Build a `<style>` text block that re-applies every generated CSS custom
14
- * property with `!important`, scoped to a unique `#id` selector.
14
+ * property with `!important`, scoped to a provider root selector.
15
15
  *
16
16
  * Why this exists:
17
17
  *
@@ -25,11 +25,9 @@ export declare function buildCardOverrideStyles(bg: string, isDark: boolean, sco
25
25
  * `[data-theme="dark"]` block. That silently nukes the provider's
26
26
  * inline values and the brand color disappears.
27
27
  *
28
- * The fix is a redundant layer that has the *highest* priority
29
- * CSS offers: an ID selector combined with `!important`. With
30
- * `#<id> { --var: v !important; }` nothing else in the cascade
31
- * can override the theme — not Tailwind defaults, not ERP global
32
- * styles, not third-party stylesheets.
28
+ * The fix is a redundant layer that has the same behavior as
29
+ * `ShopThemeProvider`: a generated style rule that writes every
30
+ * theme token with `!important` on the provider root.
33
31
  *
34
32
  * Pure: no DOM, no Vue. Returns a CSS string ready to be dropped
35
33
  * inside a `<component :is="'style'">{{ block }}</component>` block.
@@ -38,20 +36,18 @@ export declare function buildCardOverrideStyles(bg: string, isDark: boolean, sco
38
36
  * provider root `font-size` that drives the same inherited base-size behavior
39
37
  * as `ShopThemeProvider`.
40
38
  */
41
- export declare function buildThemeStyleBlock(vars: ThemeStyles, id: string): string;
39
+ export declare function buildThemeStyleBlock(vars: ThemeStyles, selector?: string): string;
42
40
  /**
43
- * Note: We previously tried to stamp `!important` directly onto every value
44
- * in the theme variables object, so that Vue inline bindings (`:style="themeStyles"`)
45
- * would carry the `!important` flag.
41
+ * Note: We keep `!important` out of the theme variables object itself.
46
42
  *
47
43
  * However, Vue's DOM patching (`style.setProperty(key, value)`) strictly rejects
48
44
  * the `value` argument if it contains `!important`. Thus, any inline style
49
45
  * object with `!important` silently fails and drops the styles entirely in SPA
50
46
  * environments.
51
47
  *
52
- * Therefore, we provide the raw variables (without `!important`) to `useThemeStyles()`
53
- * consumers, and rely exclusively on the `<style>` block generated by
54
- * `buildThemeStyleBlock` to enforce `!important` overrides across the application.
48
+ * Therefore, we provide raw variables (without `!important`) to `useThemeStyles()`
49
+ * consumers, and rely on the `<style>` block generated by `buildThemeStyleBlock`
50
+ * to enforce `!important` overrides across the application.
55
51
  */
56
52
  /**
57
53
  * Compute the full theme-styles record from a {@link ThemeProviderProps}.
@@ -345,7 +345,7 @@ ${l} .bg-card-light .bg-card-light .bg-card-light {
345
345
  `;
346
346
  }
347
347
  const O = (r) => r.replace(/[{};]/g, "");
348
- function U(r, o) {
348
+ function U(r, o = ".vlite-theme-provider") {
349
349
  if (!o) return "";
350
350
  const l = [];
351
351
  for (const [e, f] of Object.entries(r)) {
@@ -355,7 +355,7 @@ function U(r, o) {
355
355
  c.includes("!important") ? ` ${e}: ${c};` : ` ${e}: ${c} !important;`
356
356
  );
357
357
  }
358
- return l.length === 0 ? "" : `#${o} {
358
+ return l.length === 0 ? "" : `${o} {
359
359
  ${l.join(`
360
360
  `)}
361
361
  }
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "private": false,
4
4
  "description": "A Vue 3 UI component library built with Tailwind CSS.",
5
5
  "license": "MIT",
6
- "version": "1.4.15",
6
+ "version": "1.4.16",
7
7
  "type": "module",
8
8
  "main": "index.js",
9
9
  "module": "index.js",