@kaokei/use-vue-service 4.0.3 → 4.0.4

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/README.md CHANGED
@@ -26,9 +26,9 @@
26
26
 
27
27
  1. 改成tsdown来打包代码
28
28
  2. 开发devtools工具-浏览器插件
29
- 3. 开发nuxt插件,自动导入API
30
- 4. 表格宽度应该限制在装饰器页面
31
29
 
30
+ 4. 表格宽度应该限制在装饰器页面
31
+ 3. 开发nuxt插件,自动导入API
32
32
  4. 装饰器是否加小括号的表格
33
33
  4. 装饰器是否加小括号的类型兼容
34
34
  5. 整理note笔记
package/dist/index.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("@kaokei/di"),o=require("vue"),y=new c.Token("FIND_CHILD_SERVICE"),P=new c.Token("FIND_CHILDREN_SERVICES"),C=Symbol("SCOPE_KEY"),b="__raw__",a=Symbol("CONTAINER_TOKEN");function T(n){const e=n,t=o.effectScope(!0);return e[C]=t,t}function D(n){return n[C]}function V(n){const e=n;if(e){const t=D(e);t&&(t.stop(),delete e[C])}}function N(n){const e=D(n);return e||T(n)}function S(n,e,t,r){if(n){for(const i of n)if(i.isCurrentBound(e)&&(t.push(i.get(e)),r)||S(i.getChildren(),e,t,r))return!0}return!1}function F(n,e){const t=[];return S(e.getChildren(),n,t,!0),t[0]}function H(n,e){const t=[];return S(e.getChildren(),n,t,!1),t}function L(n,e,t){return c.isObject(e)?c.getOwnMetadata(b,t)?o.markRaw(e):o.reactive(e):e}function K(n){return V(n)}function W({container:n}){return e=>F(e,n)}function Y({container:n}){return e=>H(e,n)}function h(n){let e;return n?e=n.createChild():e=new c.Container,e.bind(y).toDynamicValue(W),e.bind(P).toDynamicValue(Y),e.onActivation(L),e.onDeactivation(K),e}const l=h();function s(n,e){if(typeof e=="function")e(n);else for(let t=0;t<e.length;t++)n.bind(e[t]).toSelf()}function A(){const n=o.getCurrentInstance();if(n){const e=a,t=n.provides,r=n.parent&&n.parent.provides;if(t&&t!==r&&c.hasOwn(t,e))return t[e]}}function j(n){if(!o.hasInjectionContext())throw new Error(`${n} must inside setup.`)}function g(){return o.inject(a,l)}function q(n){return j("useService"),(A()||g()).get(n)}function M(n){j("declareProviders");const e=A();if(e)s(e,n);else{const t=g(),r=h(t);s(r,n),o.provide(a,r),o.onUnmounted(()=>{r.destroy()})}}function U(n){return l.get(n)}function z(n){s(l,n)}function B(n,e){return e.runWithContext(()=>g().get(n))}function k(n,e){e.runWithContext(()=>{const t=o.inject(a,null);if(t)s(t,n);else{const r=h(l);s(r,n),e.provide(a,r),e.onUnmount(()=>{r.destroy()})}})}function G(n){return e=>k(n,e)}function _(n,e){const t=e.name;return function(){const r=this,i=o.toRaw(this),R=N(i),E=n;let p,f=Object.getPrototypeOf(i);for(;f;){const u=Object.getOwnPropertyDescriptor(f,t);if(u&&u.set){p=u.set;break}f=Object.getPrototypeOf(f)}const I=p?R.run(()=>o.computed({get:()=>E.call(r),set:u=>p.call(r,u)})):R.run(()=>o.computed(()=>E.call(r)));return Object.defineProperty(i,t,{value:I,writable:!0,configurable:!0,enumerable:!0}),I}}function $(n,e){return typeof n=="function"&&(e==null?void 0:e.kind)==="getter"?_(n,e):_}function d(n){return c.isObject(n)?o.markRaw(n):n}function m(n,e){const t=e.name;return e.addInitializer(function(){let r=this[t];Object.defineProperty(this,t,{configurable:!0,enumerable:!0,get(){return r},set(i){r=d(i)}})}),d}function O(n,e){return{get(){return n.get.call(o.toRaw(this))},set(t){n.set.call(o.toRaw(this),d(t))},init:d}}function v(n,e){e.metadata&&(e.metadata[b]=!0)}function J(n,e){return(e==null?void 0:e.kind)==="field"?m(n,e):(e==null?void 0:e.kind)==="accessor"?O(n):(e==null?void 0:e.kind)==="class"?v(n,e):(t,r)=>(r==null?void 0:r.kind)==="field"?m(t,r):(r==null?void 0:r.kind)==="accessor"?O(t):v(t,r)}function w(n,e){return function(...t){const i=N(this).run(()=>o.effectScope());return i.run(()=>n.call(this,...t)),i}}function Q(n,e){return typeof n=="function"&&(e==null?void 0:e.kind)==="method"?w(n):w}exports.Computed=$;exports.FIND_CHILDREN_SERVICES=P;exports.FIND_CHILD_SERVICE=y;exports.Raw=J;exports.RunInScope=Q;exports.declareAppProviders=k;exports.declareAppProvidersPlugin=G;exports.declareProviders=M;exports.declareRootProviders=z;exports.useAppService=B;exports.useRootService=U;exports.useService=q;Object.keys(c).forEach(n=>{n!=="default"&&!Object.prototype.hasOwnProperty.call(exports,n)&&Object.defineProperty(exports,n,{enumerable:!0,get:()=>c[n]})});
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("@kaokei/di"),o=require("vue"),y=new c.Token("FIND_CHILD_SERVICE"),P=new c.Token("FIND_CHILDREN_SERVICES"),C=Symbol("SCOPE_KEY"),N="__raw__",u=Symbol("CONTAINER_TOKEN");function k(n){const e=n,t=o.effectScope(!0);return e[C]=t,t}function b(n){return n[C]}function V(n){const e=n;if(e){const t=b(e);t&&(t.stop(),delete e[C])}}function D(n){const e=b(n);return e||k(n)}function S(n,e,t,r){if(n){for(const i of n)if(i.isCurrentBound(e)&&(t.push(i.get(e)),r)||S(i.getChildren(),e,t,r))return!0}return!1}function F(n,e){const t=[];return S(e.getChildren(),n,t,!0),t[0]}function H(n,e){const t=[];return S(e.getChildren(),n,t,!1),t}function L(n,e,t){return c.isObject(e)?c.getOwnMetadata(N,t)?o.markRaw(e):o.reactive(e):e}function K(n){return V(n)}function W({container:n}){return e=>F(e,n)}function Y({container:n}){return e=>H(e,n)}function h(n){let e;return n?e=n.createChild():e=new c.Container,e.bind(y).toDynamicValue(W),e.bind(P).toDynamicValue(Y),e.onActivation(L),e.onDeactivation(K),e}const l=h();function s(n,e){if(typeof e=="function")e(n);else for(let t=0;t<e.length;t++)n.bind(e[t]).toSelf()}function A(){const n=o.getCurrentInstance();if(n){const e=u,t=n.provides,r=n.parent&&n.parent.provides;if(t&&t!==r&&c.hasOwn(t,e))return t[e]}}function j(n){if(!o.hasInjectionContext())throw new Error(`${n} must inside setup.`)}function g(){return o.inject(u,l)}function q(n){return j("useService"),(A()||g()).get(n)}function M(n){j("declareProviders");const e=A();if(e)s(e,n);else{const t=g(),r=h(t);s(r,n),o.provide(u,r),o.onUnmounted(()=>{r.destroy()})}}function U(n){return l.get(n)}function z(n){s(l,n)}function B(n,e){return e.runWithContext(()=>g().get(n))}function T(n,e){e.runWithContext(()=>{const t=o.inject(u,null);if(t)s(t,n);else{const r=h(l);s(r,n),e.provide(u,r),e.onUnmount(()=>{r.destroy()})}})}function G(n){return e=>T(n,e)}function _(n,e){const t=e.name;return function(){const r=this,i=o.toRaw(this),E=D(i),R=n;let p,f=Object.getPrototypeOf(i);for(;f;){const a=Object.getOwnPropertyDescriptor(f,t);if(a&&a.set){p=a.set;break}f=Object.getPrototypeOf(f)}const I=p?E.run(()=>o.computed({get:()=>R.call(r),set:a=>p.call(r,a)})):E.run(()=>o.computed(()=>R.call(r)));return Object.defineProperty(i,t,{value:I,writable:!0,configurable:!0,enumerable:!0}),I}}function $(n,e){return typeof n=="function"&&(e==null?void 0:e.kind)==="getter"?_(n,e):_}function d(n){return c.isObject(n)?o.markRaw(n):n}function O(n,e){const t=e.name;return e.addInitializer(function(){let r=this[t];Object.defineProperty(this,t,{configurable:!0,enumerable:!0,get(){return r},set(i){r=d(i)}})}),d}function m(n,e){return{get(){return n.get.call(o.toRaw(this))},set(t){n.set.call(o.toRaw(this),d(t))},init:d}}function v(n,e){e.metadata&&(e.metadata[N]=!0)}function J(n,e){return(e==null?void 0:e.kind)==="field"?O(n,e):(e==null?void 0:e.kind)==="accessor"?m(n):(e==null?void 0:e.kind)==="class"?v(n,e):(t,r)=>(r==null?void 0:r.kind)==="field"?O(t,r):(r==null?void 0:r.kind)==="accessor"?m(t):v(t,r)}function w(n,e){return function(...t){const i=D(this).run(()=>o.effectScope());return i.run(()=>n.call(this,...t)),i}}function Q(n,e){return typeof n=="function"&&(e==null?void 0:e.kind)==="method"?w(n):w}exports.CONTAINER_TOKEN=u;exports.Computed=$;exports.FIND_CHILDREN_SERVICES=P;exports.FIND_CHILD_SERVICE=y;exports.Raw=J;exports.RunInScope=Q;exports.declareAppProviders=T;exports.declareAppProvidersPlugin=G;exports.declareProviders=M;exports.declareRootProviders=z;exports.useAppService=B;exports.useRootService=U;exports.useService=q;Object.keys(c).forEach(n=>{n!=="default"&&!Object.prototype.hasOwnProperty.call(exports,n)&&Object.defineProperty(exports,n,{enumerable:!0,get:()=>c[n]})});
package/dist/index.d.cts CHANGED
@@ -1,6 +1,6 @@
1
1
  export * from '@kaokei/di';
2
2
  export { useService, declareProviders, useRootService, declareRootProviders, useAppService, declareAppProviders, declareAppProvidersPlugin, } from './core.ts';
3
- export { FIND_CHILD_SERVICE, FIND_CHILDREN_SERVICES } from './constants.ts';
3
+ export { FIND_CHILD_SERVICE, FIND_CHILDREN_SERVICES, CONTAINER_TOKEN } from './constants.ts';
4
4
  export type { FindChildService, FindChildrenServices } from './interface.ts';
5
5
  export { Computed } from './computed.ts';
6
6
  export { Raw } from './raw.ts';
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  export * from '@kaokei/di';
2
2
  export { useService, declareProviders, useRootService, declareRootProviders, useAppService, declareAppProviders, declareAppProvidersPlugin, } from './core.ts';
3
- export { FIND_CHILD_SERVICE, FIND_CHILDREN_SERVICES } from './constants.ts';
3
+ export { FIND_CHILD_SERVICE, FIND_CHILDREN_SERVICES, CONTAINER_TOKEN } from './constants.ts';
4
4
  export type { FindChildService, FindChildrenServices } from './interface.ts';
5
5
  export { Computed } from './computed.ts';
6
6
  export { Raw } from './raw.ts';
package/dist/index.js CHANGED
@@ -197,6 +197,7 @@ function de(n, e) {
197
197
  return typeof n == "function" && (e == null ? void 0 : e.kind) === "method" ? y(n) : y;
198
198
  }
199
199
  export {
200
+ u as CONTAINER_TOKEN,
200
201
  ae as Computed,
201
202
  G as FIND_CHILDREN_SERVICES,
202
203
  B as FIND_CHILD_SERVICE,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kaokei/use-vue-service",
3
- "version": "4.0.3",
3
+ "version": "4.0.4",
4
4
  "type": "module",
5
5
  "description": "Lightweight Vue 3 state management with dependency injection, inspired by Angular services.",
6
6
  "main": "./dist/index.cjs",