@umber-style/vue 0.1.0-rc.0 → 0.1.0-rc.1

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
@@ -71,7 +71,7 @@ styles: {
71
71
  const local = cache === void 0 ? engine : engine.withCache(cache);
72
72
  const outerView = (0, vue.inject)(keys.view, null);
73
73
  const outerTheme = (0, vue.inject)(keys.theme, null);
74
- const readOwnTheme = () => engine.baseTheme ?? _umber_style_core.EMPTY_THEME;
74
+ const readOwnTheme = () => engine.givenTheme ?? _umber_style_core.EMPTY_THEME;
75
75
  const sets = (0, vue.computed)(() => {
76
76
  const view = local === engine ? outerView?.value ?? engine.createThemeView(readOwnTheme()) : local.createThemeView(outerTheme?.value ?? readOwnTheme());
77
77
  return local.resolveGlobal(props.styles, view);
@@ -236,9 +236,9 @@ function createThemeProvider(baseEngine, keys) {
236
236
  const outer = (0, vue.inject)(keys.theme, null);
237
237
  const scope = (0, vue.inject)(keys.engine, null) === engine ? (0, vue.inject)(keys.scope, null) : null;
238
238
  const isNested = scope !== null && !props.isRoot;
239
- const readOuter = () => outer?.value ?? engine.baseTheme;
239
+ const readOuter = () => outer?.value ?? engine.givenTheme;
240
240
  const given = (0, vue.computed)(() => (0, _umber_style_core.resolveThemeInput)(props.theme, readOuter() ?? _umber_style_core.EMPTY_THEME));
241
- if (!engine.hasTheme) engine.setTheme(given.value);
241
+ engine.adoptTheme(given.value);
242
242
  const merged = (0, vue.computed)(() => (0, _umber_style_core.mergeTheme)(readOuter(), given.value));
243
243
  const classes = (0, vue.computed)(() => {
244
244
  const own = engine.themeClass(given.value, props.colorScheme);
@@ -291,8 +291,8 @@ function createThemeScope(keys) {
291
291
  function bindEngine(engine) {
292
292
  const keys = createThemeKeys();
293
293
  const { ThemeScope, useThemeClass } = createThemeScope(keys);
294
- /** The theme where no provider is above: the base theme, or the empty theme. */
295
- const readOwnTheme = () => engine.baseTheme ?? _umber_style_core.EMPTY_THEME;
294
+ /** The theme where no provider is above: the base theme given on purpose, or the empty theme; never one that a provider gave the engine. */
295
+ const readOwnTheme = () => engine.givenTheme ?? _umber_style_core.EMPTY_THEME;
296
296
  const useTheme = () => (0, vue.inject)(keys.theme, null) ?? (0, vue.computed)(readOwnTheme);
297
297
  const useThemeView = (cache) => {
298
298
  const local = cache === void 0 ? engine : engine.withCache(cache);
@@ -329,7 +329,7 @@ function bindEngine(engine) {
329
329
  /** Makes the Vue styling of one theme shape, apart from the default one: its own engine, or the one given. */
330
330
  function createStyle(theme, options = {}) {
331
331
  const engine = options.engine ?? (0, _umber_style_core.createEngine)(theme, options);
332
- if (!engine.hasTheme) engine.setTheme(theme);
332
+ if (engine.givenTheme === void 0) engine.setTheme(theme);
333
333
  return bindEngine(engine);
334
334
  }
335
335
  // src/defaultStyle.ts
package/dist/index.d.cts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { Component, ComputedRef, FunctionalComponent, IntrinsicElementAttributes, PropType } from "vue";
2
- import { AlphaColor, BindingOptions, CSSObject, Cache, ColorScheme, ComponentSelector, CssArgument, CssArgument as CssArgument$1, Engine, GlobalInput, GlobalInput as GlobalInput$1, GlobalStyleObject, GlobalStyleObject as GlobalStyleObject$1, GlobalStyles, GlobalStyles as GlobalStyles$1, GlobalStylesInput, Interpolation as Interpolation$1, InterpolationResult, InterpolationResult as InterpolationResult$1, Keyframes, Keyframes as Keyframes$1, KeyframesInput, KeyframesOptions, KeyframesSteps, KeyframesSteps as KeyframesSteps$1, NestedKey, ObjectSheet, SchemeKey, SchemeName, SerializedStyles, SerializedStyles as SerializedStyles$1, SheetEntry, SheetEntry as SheetEntry$1, SheetStyles, StaticTemplateValue, StaticTemplateValue as StaticTemplateValue$1, StyleInput, StyleObject, StylerOptions, TemplateValue, TemplateValue as TemplateValue$1, Theme as Theme$1, ThemeInput, ThemeInput as ThemeInput$1, ThemeKey, UmberCache, WebNested, WebProperties, WebStyleObject, WebStyleObject as WebStyleObject$1, add, alpha, at, divide, multiply, negate, subtract } from "@umber-style/core";
2
+ import { AlphaColor, BindingOptions, CSSObject, Cache, ColorScheme, ComponentSelector, CssArgument, CssArgument as CssArgument$1, Engine, GlobalInput, GlobalInput as GlobalInput$1, GlobalStyleObject, GlobalStyleObject as GlobalStyleObject$1, GlobalStyles, GlobalStyles as GlobalStyles$1, GlobalStylesInput, Interpolation as Interpolation$1, InterpolationResult, InterpolationResult as InterpolationResult$1, Keyframes, Keyframes as Keyframes$1, KeyframesInput, KeyframesOptions, KeyframesSteps, KeyframesSteps as KeyframesSteps$1, NestedKey, ObjectSheet, SchemeKey, SchemeName, SerializedStyles, SerializedStyles as SerializedStyles$1, SheetEntry, SheetEntry as SheetEntry$1, SheetStyles, StaticTemplateValue, StaticTemplateValue as StaticTemplateValue$1, StyleInput, StyleObject, StyleTypeOptions, StylerOptions, TemplateValue, TemplateValue as TemplateValue$1, Theme as Theme$1, ThemeInput, ThemeInput as ThemeInput$1, ThemeKey, UmberCache, WebNested, WebProperties, WebStyleObject, WebStyleObject as WebStyleObject$1, add, alpha, at, divide, multiply, negate, subtract } from "@umber-style/core";
3
3
  /**
4
4
  * The theme of the default style of this binding: what `styled`, `useTheme`, `StyleSheet` and
5
5
  * `ThemeProvider` of the default style read. It extends the core's `Theme`, so an app gives it members
@@ -258,4 +258,4 @@ export declare const configure: (options: DefaultStyleOptions) => void, getEngin
258
258
  (template: TemplateStringsArray, ...values: import("@umber-style/core").TemplateValue<unknown, Theme>[]): import("@umber-style/core").GlobalStyles<Theme>;
259
259
  (styles: import("@umber-style/core").GlobalStylesInput<Theme>): import("@umber-style/core").GlobalStyles<Theme>;
260
260
  }, Global: import("vue").Component<GlobalProps<Theme>>;
261
- export { type AlphaColor, type CSSObject, type ComponentSelector, type CssArgument, type GlobalInput, type GlobalStyleObject, type GlobalStyles, type InterpolationResult, type Keyframes, type KeyframesSteps, type NestedKey, type SchemeKey, type SchemeName, type SerializedStyles, type SheetEntry, type StaticTemplateValue, type StyleObject, type TemplateValue, type ThemeInput, type ThemeKey, type UmberCache, type WebNested, type WebProperties, type WebStyleObject, add, alpha, at, divide, multiply, negate, subtract };
261
+ export { type AlphaColor, type CSSObject, type ComponentSelector, type CssArgument, type GlobalInput, type GlobalStyleObject, type GlobalStyles, type InterpolationResult, type Keyframes, type KeyframesSteps, type NestedKey, type SchemeKey, type SchemeName, type SerializedStyles, type SheetEntry, type StaticTemplateValue, type StyleObject, type StyleTypeOptions, type TemplateValue, type ThemeInput, type ThemeKey, type UmberCache, type WebNested, type WebProperties, type WebStyleObject, add, alpha, at, divide, multiply, negate, subtract };
package/dist/index.d.mts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { Component, ComputedRef, FunctionalComponent, IntrinsicElementAttributes, PropType } from "vue";
2
- import { AlphaColor, BindingOptions, CSSObject, Cache, ColorScheme, ComponentSelector, CssArgument, CssArgument as CssArgument$1, Engine, GlobalInput, GlobalInput as GlobalInput$1, GlobalStyleObject, GlobalStyleObject as GlobalStyleObject$1, GlobalStyles, GlobalStyles as GlobalStyles$1, GlobalStylesInput, Interpolation as Interpolation$1, InterpolationResult, InterpolationResult as InterpolationResult$1, Keyframes, Keyframes as Keyframes$1, KeyframesInput, KeyframesOptions, KeyframesSteps, KeyframesSteps as KeyframesSteps$1, NestedKey, ObjectSheet, SchemeKey, SchemeName, SerializedStyles, SerializedStyles as SerializedStyles$1, SheetEntry, SheetEntry as SheetEntry$1, SheetStyles, StaticTemplateValue, StaticTemplateValue as StaticTemplateValue$1, StyleInput, StyleObject, StylerOptions, TemplateValue, TemplateValue as TemplateValue$1, Theme as Theme$1, ThemeInput, ThemeInput as ThemeInput$1, ThemeKey, UmberCache, WebNested, WebProperties, WebStyleObject, WebStyleObject as WebStyleObject$1, add, alpha, at, divide, multiply, negate, subtract } from "@umber-style/core";
2
+ import { AlphaColor, BindingOptions, CSSObject, Cache, ColorScheme, ComponentSelector, CssArgument, CssArgument as CssArgument$1, Engine, GlobalInput, GlobalInput as GlobalInput$1, GlobalStyleObject, GlobalStyleObject as GlobalStyleObject$1, GlobalStyles, GlobalStyles as GlobalStyles$1, GlobalStylesInput, Interpolation as Interpolation$1, InterpolationResult, InterpolationResult as InterpolationResult$1, Keyframes, Keyframes as Keyframes$1, KeyframesInput, KeyframesOptions, KeyframesSteps, KeyframesSteps as KeyframesSteps$1, NestedKey, ObjectSheet, SchemeKey, SchemeName, SerializedStyles, SerializedStyles as SerializedStyles$1, SheetEntry, SheetEntry as SheetEntry$1, SheetStyles, StaticTemplateValue, StaticTemplateValue as StaticTemplateValue$1, StyleInput, StyleObject, StyleTypeOptions, StylerOptions, TemplateValue, TemplateValue as TemplateValue$1, Theme as Theme$1, ThemeInput, ThemeInput as ThemeInput$1, ThemeKey, UmberCache, WebNested, WebProperties, WebStyleObject, WebStyleObject as WebStyleObject$1, add, alpha, at, divide, multiply, negate, subtract } from "@umber-style/core";
3
3
  /**
4
4
  * The theme of the default style of this binding: what `styled`, `useTheme`, `StyleSheet` and
5
5
  * `ThemeProvider` of the default style read. It extends the core's `Theme`, so an app gives it members
@@ -258,4 +258,4 @@ export declare const configure: (options: DefaultStyleOptions) => void, getEngin
258
258
  (template: TemplateStringsArray, ...values: import("@umber-style/core").TemplateValue<unknown, Theme>[]): import("@umber-style/core").GlobalStyles<Theme>;
259
259
  (styles: import("@umber-style/core").GlobalStylesInput<Theme>): import("@umber-style/core").GlobalStyles<Theme>;
260
260
  }, Global: import("vue").Component<GlobalProps<Theme>>;
261
- export { type AlphaColor, type CSSObject, type ComponentSelector, type CssArgument, type GlobalInput, type GlobalStyleObject, type GlobalStyles, type InterpolationResult, type Keyframes, type KeyframesSteps, type NestedKey, type SchemeKey, type SchemeName, type SerializedStyles, type SheetEntry, type StaticTemplateValue, type StyleObject, type TemplateValue, type ThemeInput, type ThemeKey, type UmberCache, type WebNested, type WebProperties, type WebStyleObject, add, alpha, at, divide, multiply, negate, subtract };
261
+ export { type AlphaColor, type CSSObject, type ComponentSelector, type CssArgument, type GlobalInput, type GlobalStyleObject, type GlobalStyles, type InterpolationResult, type Keyframes, type KeyframesSteps, type NestedKey, type SchemeKey, type SchemeName, type SerializedStyles, type SheetEntry, type StaticTemplateValue, type StyleObject, type StyleTypeOptions, type TemplateValue, type ThemeInput, type ThemeKey, type UmberCache, type WebNested, type WebProperties, type WebStyleObject, add, alpha, at, divide, multiply, negate, subtract };
package/dist/index.mjs CHANGED
@@ -70,7 +70,7 @@ styles: {
70
70
  const local = cache === void 0 ? engine : engine.withCache(cache);
71
71
  const outerView = inject(keys.view, null);
72
72
  const outerTheme = inject(keys.theme, null);
73
- const readOwnTheme = () => engine.baseTheme ?? EMPTY_THEME;
73
+ const readOwnTheme = () => engine.givenTheme ?? EMPTY_THEME;
74
74
  const sets = computed(() => {
75
75
  const view = local === engine ? outerView?.value ?? engine.createThemeView(readOwnTheme()) : local.createThemeView(outerTheme?.value ?? readOwnTheme());
76
76
  return local.resolveGlobal(props.styles, view);
@@ -235,9 +235,9 @@ function createThemeProvider(baseEngine, keys) {
235
235
  const outer = inject(keys.theme, null);
236
236
  const scope = inject(keys.engine, null) === engine ? inject(keys.scope, null) : null;
237
237
  const isNested = scope !== null && !props.isRoot;
238
- const readOuter = () => outer?.value ?? engine.baseTheme;
238
+ const readOuter = () => outer?.value ?? engine.givenTheme;
239
239
  const given = computed(() => resolveThemeInput(props.theme, readOuter() ?? EMPTY_THEME));
240
- if (!engine.hasTheme) engine.setTheme(given.value);
240
+ engine.adoptTheme(given.value);
241
241
  const merged = computed(() => mergeTheme(readOuter(), given.value));
242
242
  const classes = computed(() => {
243
243
  const own = engine.themeClass(given.value, props.colorScheme);
@@ -290,8 +290,8 @@ function createThemeScope(keys) {
290
290
  function bindEngine(engine) {
291
291
  const keys = createThemeKeys();
292
292
  const { ThemeScope, useThemeClass } = createThemeScope(keys);
293
- /** The theme where no provider is above: the base theme, or the empty theme. */
294
- const readOwnTheme = () => engine.baseTheme ?? EMPTY_THEME;
293
+ /** The theme where no provider is above: the base theme given on purpose, or the empty theme; never one that a provider gave the engine. */
294
+ const readOwnTheme = () => engine.givenTheme ?? EMPTY_THEME;
295
295
  const useTheme = () => inject(keys.theme, null) ?? computed(readOwnTheme);
296
296
  const useThemeView = (cache) => {
297
297
  const local = cache === void 0 ? engine : engine.withCache(cache);
@@ -328,7 +328,7 @@ function bindEngine(engine) {
328
328
  /** Makes the Vue styling of one theme shape, apart from the default one: its own engine, or the one given. */
329
329
  function createStyle(theme, options = {}) {
330
330
  const engine = options.engine ?? createEngine(theme, options);
331
- if (!engine.hasTheme) engine.setTheme(theme);
331
+ if (engine.givenTheme === void 0) engine.setTheme(theme);
332
332
  return bindEngine(engine);
333
333
  }
334
334
  // src/defaultStyle.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@umber-style/vue",
3
- "version": "0.1.0-rc.0",
3
+ "version": "0.1.0-rc.1",
4
4
  "description": "UmberStyle for Vue: the same names as the React binding, with a reactive useTheme.",
5
5
  "keywords": [
6
6
  "styling",
@@ -43,7 +43,7 @@
43
43
  "access": "public"
44
44
  },
45
45
  "dependencies": {
46
- "@umber-style/core": "0.1.0-rc.0"
46
+ "@umber-style/core": "0.1.0-rc.1"
47
47
  },
48
48
  "peerDependencies": {
49
49
  "vue": "^3.5.0"
@@ -63,7 +63,7 @@
63
63
  "scripts": {
64
64
  "build": "tsdown",
65
65
  "lint": "oxlint --deny-warnings",
66
- "typecheck": "tsc --noEmit && tsc --noEmit -p tsconfig.defaultStyle.json",
66
+ "typecheck": "tsc --noEmit && tsc --noEmit -p tsconfig.defaultStyle.json && tsc --noEmit -p tsconfig.strict.json",
67
67
  "test": "vitest run",
68
68
  "test:coverage": "vitest run --coverage"
69
69
  },