@umber-style/vue 0.1.0-rc.2 → 0.2.0-alpha.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/dist/index.cjs +8 -7
- package/dist/index.mjs +9 -8
- package/package.json +4 -3
package/dist/index.cjs
CHANGED
|
@@ -2,12 +2,13 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
2
2
|
let _umber_style_core = require("@umber-style/core");
|
|
3
3
|
let vue = require("vue");
|
|
4
4
|
// src/CacheProvider.ts
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
const provided = (0, _umber_style_core.readSharedState)("vue.cache-provider@1", () => ({
|
|
6
|
+
key: Symbol("cache"),
|
|
7
|
+
isProvided: false
|
|
8
|
+
}));
|
|
8
9
|
/** The cache of the nearest `CacheProvider`, or undefined with none above. Call it in `setup` or in a functional component. */
|
|
9
10
|
function injectCache() {
|
|
10
|
-
return isProvided ? (0, vue.inject)(
|
|
11
|
+
return provided.isProvided ? (0, vue.inject)(provided.key, void 0) : void 0;
|
|
11
12
|
}
|
|
12
13
|
/**
|
|
13
14
|
* Gives the subtree in its slot its cache: every rule that a component of the binding writes there goes
|
|
@@ -25,8 +26,8 @@ value: {
|
|
|
25
26
|
required: true
|
|
26
27
|
} },
|
|
27
28
|
setup(props, { slots }) {
|
|
28
|
-
isProvided = true;
|
|
29
|
-
(0, vue.provide)(
|
|
29
|
+
provided.isProvided = true;
|
|
30
|
+
(0, vue.provide)(provided.key, props.value);
|
|
30
31
|
return () => slots.default?.();
|
|
31
32
|
}
|
|
32
33
|
});
|
|
@@ -402,7 +403,7 @@ function createDefaultStyle() {
|
|
|
402
403
|
Global
|
|
403
404
|
};
|
|
404
405
|
}
|
|
405
|
-
const { configure, getEngine, styled, StyleSheet, useStyle, useTheme, ThemeProvider, ThemeScope, useThemeClass, apply, css, themeClass, when, whenScheme, keyframes, globalStyles, Global } =
|
|
406
|
+
const { configure, getEngine, styled, StyleSheet, useStyle, useTheme, ThemeProvider, ThemeScope, useThemeClass, apply, css, themeClass, when, whenScheme, keyframes, globalStyles, Global } = (0, _umber_style_core.readSharedState)("vue.default-style@1", createDefaultStyle);
|
|
406
407
|
exports.CacheProvider = CacheProvider;
|
|
407
408
|
exports.Global = Global;
|
|
408
409
|
exports.StyleSheet = StyleSheet;
|
package/dist/index.mjs
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import { EMPTY_THEME, add, alpha, at, createComponentSelector, createCssEntry, createDeferredObject, createDeferredRecord, createEngine, createGlobalMarker, createLazyEngine, divide, findEntryCache, flattenStyle, globalStyles as globalStyles$1, isThemedSheet, keyframes as keyframes$1, mergeTheme, multiply, negate, readStyleArguments, resolveThemeInput, subtract, withTagShorthands } from "@umber-style/core";
|
|
1
|
+
import { EMPTY_THEME, add, alpha, at, createComponentSelector, createCssEntry, createDeferredObject, createDeferredRecord, createEngine, createGlobalMarker, createLazyEngine, divide, findEntryCache, flattenStyle, globalStyles as globalStyles$1, isThemedSheet, keyframes as keyframes$1, mergeTheme, multiply, negate, readSharedState, readStyleArguments, resolveThemeInput, subtract, withTagShorthands } from "@umber-style/core";
|
|
2
2
|
import { Comment, computed, defineComponent, h, inject, mergeProps, normalizeClass, onUnmounted, provide, watch } from "vue";
|
|
3
3
|
// src/CacheProvider.ts
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
const provided = readSharedState("vue.cache-provider@1", () => ({
|
|
5
|
+
key: Symbol("cache"),
|
|
6
|
+
isProvided: false
|
|
7
|
+
}));
|
|
7
8
|
/** The cache of the nearest `CacheProvider`, or undefined with none above. Call it in `setup` or in a functional component. */
|
|
8
9
|
function injectCache() {
|
|
9
|
-
return isProvided ? inject(
|
|
10
|
+
return provided.isProvided ? inject(provided.key, void 0) : void 0;
|
|
10
11
|
}
|
|
11
12
|
/**
|
|
12
13
|
* Gives the subtree in its slot its cache: every rule that a component of the binding writes there goes
|
|
@@ -24,8 +25,8 @@ value: {
|
|
|
24
25
|
required: true
|
|
25
26
|
} },
|
|
26
27
|
setup(props, { slots }) {
|
|
27
|
-
isProvided = true;
|
|
28
|
-
provide(
|
|
28
|
+
provided.isProvided = true;
|
|
29
|
+
provide(provided.key, props.value);
|
|
29
30
|
return () => slots.default?.();
|
|
30
31
|
}
|
|
31
32
|
});
|
|
@@ -401,5 +402,5 @@ function createDefaultStyle() {
|
|
|
401
402
|
Global
|
|
402
403
|
};
|
|
403
404
|
}
|
|
404
|
-
const { configure, getEngine, styled, StyleSheet, useStyle, useTheme, ThemeProvider, ThemeScope, useThemeClass, apply, css, themeClass, when, whenScheme, keyframes, globalStyles, Global } = createDefaultStyle
|
|
405
|
+
const { configure, getEngine, styled, StyleSheet, useStyle, useTheme, ThemeProvider, ThemeScope, useThemeClass, apply, css, themeClass, when, whenScheme, keyframes, globalStyles, Global } = readSharedState("vue.default-style@1", createDefaultStyle);
|
|
405
406
|
export { CacheProvider, Global, StyleSheet, ThemeProvider, ThemeScope, add, alpha, apply, at, bindEngine, configure, createDefaultStyle, createStyle, css, divide, getEngine, globalStyles, keyframes, multiply, negate, styled, subtract, themeClass, useStyle, useTheme, useThemeClass, when, whenScheme };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@umber-style/vue",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0-alpha.0",
|
|
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.
|
|
46
|
+
"@umber-style/core": "^0.2.0-alpha.1"
|
|
47
47
|
},
|
|
48
48
|
"peerDependencies": {
|
|
49
49
|
"vue": "^3.5.0"
|
|
@@ -58,7 +58,8 @@
|
|
|
58
58
|
"typescript": "~7.0.2",
|
|
59
59
|
"vitest": "^5.1.0",
|
|
60
60
|
"vue": "^3.5.45",
|
|
61
|
-
"@umber-style/eslint-config": "0.0.0"
|
|
61
|
+
"@umber-style/eslint-config": "0.0.0",
|
|
62
|
+
"@umber-style/is-prop-valid": "0.2.0-alpha.0"
|
|
62
63
|
},
|
|
63
64
|
"scripts": {
|
|
64
65
|
"build": "tsdown",
|