@ctorforce/ui 1.0.2 → 1.0.3
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/ctorforce-ui.cjs +2 -0
- package/dist/ctorforce-ui.cjs.map +1 -0
- package/dist/ctorforce-ui.mjs +5 -7
- package/dist/ctorforce-ui.mjs.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/resolver.cjs +2 -0
- package/dist/resolver.cjs.map +1 -0
- package/dist/resolver.d.ts +16 -0
- package/dist/resolver.mjs +26 -0
- package/dist/resolver.mjs.map +1 -0
- package/dist/src/component-manifest.d.ts +5 -0
- package/dist/src/components/Button.vue.d.ts +4 -1
- package/dist/style.css +1 -0
- package/dist/styles/button.css +4 -0
- package/package.json +61 -35
- package/dist/ctorforce-ui.css +0 -2
- package/dist/ctorforce-ui.umd.js +0 -1
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let e=require(`vue`);var t={class:`cf-button`},n=(0,e.defineComponent)({__name:`Button`,props:{type:{}},setup(n){return(n,r)=>((0,e.openBlock)(),(0,e.createElementBlock)(`button`,t,[(0,e.renderSlot)(n.$slots,`default`)]))}});exports.Button=n;
|
|
2
|
+
//# sourceMappingURL=ctorforce-ui.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ctorforce-ui.cjs","names":[],"sources":["../src/components/Button.vue","../src/components/Button.vue"],"sourcesContent":["<script setup lang=\"ts\">\ndefineProps<{\n type?: 'primary' | 'default'\n}>()\n</script>\n\n<template>\n <button class=\"cf-button\">\n <slot />\n </button>\n</template>\n","<script setup lang=\"ts\">\ndefineProps<{\n type?: 'primary' | 'default'\n}>()\n</script>\n\n<template>\n <button class=\"cf-button\">\n <slot />\n </button>\n</template>\n"],"mappings":"6OASW,SAFT,EAES,EAAA,EAAA,EAAA,YADC,EAAA,OAAA,UAAA,CAAA,CAAA"}
|
package/dist/ctorforce-ui.mjs
CHANGED
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
import { createElementBlock as e, defineComponent as t, openBlock as n, renderSlot as r } from "vue";
|
|
2
2
|
//#region src/components/Button.vue?vue&type=script&setup=true&lang.ts
|
|
3
|
-
var i = { class: "cf-button" }, a = /* @__PURE__ */ (
|
|
4
|
-
let n = e.__vccOpts || e;
|
|
5
|
-
for (let [e, r] of t) n[e] = r;
|
|
6
|
-
return n;
|
|
7
|
-
})(/* @__PURE__ */ t({
|
|
3
|
+
var i = { class: "cf-button" }, a = /* @__PURE__ */ t({
|
|
8
4
|
__name: "Button",
|
|
9
5
|
props: { type: {} },
|
|
10
6
|
setup(t) {
|
|
11
|
-
return (t, a) => (n(), e("button", i, [r(t.$slots, "default"
|
|
7
|
+
return (t, a) => (n(), e("button", i, [r(t.$slots, "default")]));
|
|
12
8
|
}
|
|
13
|
-
})
|
|
9
|
+
});
|
|
14
10
|
//#endregion
|
|
15
11
|
export { a as Button };
|
|
12
|
+
|
|
13
|
+
//# sourceMappingURL=ctorforce-ui.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ctorforce-ui.mjs","names":[],"sources":["../src/components/Button.vue","../src/components/Button.vue"],"sourcesContent":["<script setup lang=\"ts\">\ndefineProps<{\n type?: 'primary' | 'default'\n}>()\n</script>\n\n<template>\n <button class=\"cf-button\">\n <slot />\n </button>\n</template>\n","<script setup lang=\"ts\">\ndefineProps<{\n type?: 'primary' | 'default'\n}>()\n</script>\n\n<template>\n <button class=\"cf-button\">\n <slot />\n </button>\n</template>\n"],"mappings":";;;;;;yBAOE,EAES,UAFT,GAES,CADP,EAAQ,EAAA,QAAA,UAAA,CAAA,CAAA"}
|
package/dist/index.d.ts
CHANGED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});var e=new Map([{name:`Button`,styleFile:`button.css`}].map(e=>[e.name,e.styleFile]));function t(t={}){let{importStyle:n=`css`,prefix:r=`Cf`}=t,i=Array.isArray(r)?[...r].sort((e,t)=>t.length-e.length):[r];return{type:`component`,resolve:t=>{let r=i.find(e=>t.startsWith(e)),a=r?t.slice(r.length):t;if(!e.has(a))return;let o=e.get(a);return{name:a,from:`@ctorforce/ui`,sideEffects:n&&o?`@ctorforce/ui/styles/${o}`:void 0}}}}exports.CtorforceResolver=t;
|
|
2
|
+
//# sourceMappingURL=resolver.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolver.cjs","names":[],"sources":["../src/component-manifest.ts","../resolver.ts"],"sourcesContent":["export type ComponentMeta = {\n name: string\n styleFile: string | null\n}\n\nexport const componentManifest: ComponentMeta[] = [\n {\n \"name\": \"Button\",\n \"styleFile\": \"button.css\"\n }\n]\n","type ImportStyle = boolean | 'css'\n\nimport { componentManifest } from './src/component-manifest'\n\ntype ResolverResult = {\n name: string\n from: string\n sideEffects?: string | string[]\n}\n\nexport type CtorforceResolverOptions = {\n importStyle?: ImportStyle\n prefix?: string | string[]\n}\n\nexport type ComponentResolver = {\n type: 'component'\n resolve: (componentName: string) => ResolverResult | undefined\n}\n\nconst components = new Map(\n componentManifest.map((item) => [item.name, item.styleFile])\n)\n\nexport function CtorforceResolver(\n options: CtorforceResolverOptions = {}\n): ComponentResolver {\n const { importStyle = 'css', prefix = 'Cf' } = options\n const prefixes = Array.isArray(prefix)\n ? [...prefix].sort((a, b) => b.length - a.length)\n : [prefix]\n\n return {\n type: 'component',\n resolve: (componentName) => {\n const matchedPrefix = prefixes.find((item) =>\n componentName.startsWith(item)\n )\n const normalizedName = matchedPrefix\n ? componentName.slice(matchedPrefix.length)\n : componentName\n\n if (!components.has(normalizedName)) {\n return undefined\n }\n\n const styleFile = components.get(normalizedName)\n\n return {\n name: normalizedName,\n from: '@ctorforce/ui',\n sideEffects:\n importStyle && styleFile\n ? `@ctorforce/ui/styles/${styleFile}`\n : undefined,\n }\n },\n }\n}\n"],"mappings":"mECoBA,IAAM,EAAa,IAAI,IDf2B,CAChD,CACE,KAAQ,SACR,UAAa,aACd,CACF,CCWmB,IAAK,GAAS,CAAC,EAAK,KAAM,EAAK,UAAU,CAAC,CAC7D,CAED,SAAgB,EACd,EAAoC,EAAE,CACnB,CACnB,GAAM,CAAE,cAAc,MAAO,SAAS,MAAS,EACzC,EAAW,MAAM,QAAQ,EAAO,CAClC,CAAC,GAAG,EAAO,CAAC,MAAM,EAAG,IAAM,EAAE,OAAS,EAAE,OAAO,CAC/C,CAAC,EAAO,CAEZ,MAAO,CACL,KAAM,YACN,QAAU,GAAkB,CAC1B,IAAM,EAAgB,EAAS,KAAM,GACnC,EAAc,WAAW,EAAK,CAC/B,CACK,EAAiB,EACnB,EAAc,MAAM,EAAc,OAAO,CACzC,EAEJ,GAAI,CAAC,EAAW,IAAI,EAAe,CACjC,OAGF,IAAM,EAAY,EAAW,IAAI,EAAe,CAEhD,MAAO,CACL,KAAM,EACN,KAAM,gBACN,YACE,GAAe,EACX,wBAAwB,IACxB,IAAA,GACP,EAEJ"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
type ImportStyle = boolean | 'css';
|
|
2
|
+
type ResolverResult = {
|
|
3
|
+
name: string;
|
|
4
|
+
from: string;
|
|
5
|
+
sideEffects?: string | string[];
|
|
6
|
+
};
|
|
7
|
+
export type CtorforceResolverOptions = {
|
|
8
|
+
importStyle?: ImportStyle;
|
|
9
|
+
prefix?: string | string[];
|
|
10
|
+
};
|
|
11
|
+
export type ComponentResolver = {
|
|
12
|
+
type: 'component';
|
|
13
|
+
resolve: (componentName: string) => ResolverResult | undefined;
|
|
14
|
+
};
|
|
15
|
+
export declare function CtorforceResolver(options?: CtorforceResolverOptions): ComponentResolver;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
//#endregion
|
|
2
|
+
//#region resolver.ts
|
|
3
|
+
var e = new Map([{
|
|
4
|
+
name: "Button",
|
|
5
|
+
styleFile: "button.css"
|
|
6
|
+
}].map((e) => [e.name, e.styleFile]));
|
|
7
|
+
function t(t = {}) {
|
|
8
|
+
let { importStyle: n = "css", prefix: r = "Cf" } = t, i = Array.isArray(r) ? [...r].sort((e, t) => t.length - e.length) : [r];
|
|
9
|
+
return {
|
|
10
|
+
type: "component",
|
|
11
|
+
resolve: (t) => {
|
|
12
|
+
let r = i.find((e) => t.startsWith(e)), a = r ? t.slice(r.length) : t;
|
|
13
|
+
if (!e.has(a)) return;
|
|
14
|
+
let o = e.get(a);
|
|
15
|
+
return {
|
|
16
|
+
name: a,
|
|
17
|
+
from: "@ctorforce/ui",
|
|
18
|
+
sideEffects: n && o ? `@ctorforce/ui/styles/${o}` : void 0
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
//#endregion
|
|
24
|
+
export { t as CtorforceResolver };
|
|
25
|
+
|
|
26
|
+
//# sourceMappingURL=resolver.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolver.mjs","names":[],"sources":["../src/component-manifest.ts","../resolver.ts"],"sourcesContent":["export type ComponentMeta = {\n name: string\n styleFile: string | null\n}\n\nexport const componentManifest: ComponentMeta[] = [\n {\n \"name\": \"Button\",\n \"styleFile\": \"button.css\"\n }\n]\n","type ImportStyle = boolean | 'css'\n\nimport { componentManifest } from './src/component-manifest'\n\ntype ResolverResult = {\n name: string\n from: string\n sideEffects?: string | string[]\n}\n\nexport type CtorforceResolverOptions = {\n importStyle?: ImportStyle\n prefix?: string | string[]\n}\n\nexport type ComponentResolver = {\n type: 'component'\n resolve: (componentName: string) => ResolverResult | undefined\n}\n\nconst components = new Map(\n componentManifest.map((item) => [item.name, item.styleFile])\n)\n\nexport function CtorforceResolver(\n options: CtorforceResolverOptions = {}\n): ComponentResolver {\n const { importStyle = 'css', prefix = 'Cf' } = options\n const prefixes = Array.isArray(prefix)\n ? [...prefix].sort((a, b) => b.length - a.length)\n : [prefix]\n\n return {\n type: 'component',\n resolve: (componentName) => {\n const matchedPrefix = prefixes.find((item) =>\n componentName.startsWith(item)\n )\n const normalizedName = matchedPrefix\n ? componentName.slice(matchedPrefix.length)\n : componentName\n\n if (!components.has(normalizedName)) {\n return undefined\n }\n\n const styleFile = components.get(normalizedName)\n\n return {\n name: normalizedName,\n from: '@ctorforce/ui',\n sideEffects:\n importStyle && styleFile\n ? `@ctorforce/ui/styles/${styleFile}`\n : undefined,\n }\n },\n }\n}\n"],"mappings":";;ACoBA,IAAM,IAAa,IAAI,IDf2B,CAChD;CACE,MAAQ;CACR,WAAa;CACd,CACF,CCWmB,KAAK,MAAS,CAAC,EAAK,MAAM,EAAK,UAAU,CAAC,CAC7D;AAED,SAAgB,EACd,IAAoC,EAAE,EACnB;CACnB,IAAM,EAAE,iBAAc,OAAO,YAAS,SAAS,GACzC,IAAW,MAAM,QAAQ,EAAO,GAClC,CAAC,GAAG,EAAO,CAAC,MAAM,GAAG,MAAM,EAAE,SAAS,EAAE,OAAO,GAC/C,CAAC,EAAO;AAEZ,QAAO;EACL,MAAM;EACN,UAAU,MAAkB;GAC1B,IAAM,IAAgB,EAAS,MAAM,MACnC,EAAc,WAAW,EAAK,CAC/B,EACK,IAAiB,IACnB,EAAc,MAAM,EAAc,OAAO,GACzC;AAEJ,OAAI,CAAC,EAAW,IAAI,EAAe,CACjC;GAGF,IAAM,IAAY,EAAW,IAAI,EAAe;AAEhD,UAAO;IACL,MAAM;IACN,MAAM;IACN,aACE,KAAe,IACX,wBAAwB,MACxB,KAAA;IACP;;EAEJ"}
|
|
@@ -1,8 +1,11 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
type?: 'primary' | 'default';
|
|
3
|
+
};
|
|
1
4
|
declare var __VLS_1: {};
|
|
2
5
|
type __VLS_Slots = {} & {
|
|
3
6
|
default?: (props: typeof __VLS_1) => any;
|
|
4
7
|
};
|
|
5
|
-
declare const __VLS_base: any
|
|
8
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
6
9
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
7
10
|
declare const _default: typeof __VLS_export;
|
|
8
11
|
export default _default;
|
package/dist/style.css
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.cf-button{border-radius:6px;padding:8px 16px}
|
package/package.json
CHANGED
|
@@ -1,39 +1,65 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
2
|
+
"name": "@ctorforce/ui",
|
|
3
|
+
"version": "1.0.3",
|
|
4
|
+
"description": "Vue 3 UI components for the ctorforce workspace.",
|
|
5
|
+
"main": "./dist/ctorforce-ui.cjs",
|
|
6
|
+
"module": "./dist/ctorforce-ui.mjs",
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
8
|
+
"sideEffects": [
|
|
9
|
+
"**/*.css"
|
|
10
|
+
],
|
|
11
|
+
"exports": {
|
|
12
|
+
".": {
|
|
13
|
+
"types": "./dist/index.d.ts",
|
|
14
|
+
"import": "./dist/ctorforce-ui.mjs",
|
|
15
|
+
"require": "./dist/ctorforce-ui.cjs"
|
|
15
16
|
},
|
|
16
|
-
"
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
"test": "echo \"Error: no test specified\" && exit 1",
|
|
21
|
-
"build": "vite build && npm run build:types",
|
|
22
|
-
"build:types": "vue-tsc --project tsconfig.json --declaration --emitDeclarationOnly --outDir dist",
|
|
23
|
-
"type-check": "vue-tsc --noEmit",
|
|
24
|
-
"prepublishOnly": "npm run build"
|
|
17
|
+
"./resolver": {
|
|
18
|
+
"types": "./dist/resolver.d.ts",
|
|
19
|
+
"import": "./dist/resolver.mjs",
|
|
20
|
+
"require": "./dist/resolver.cjs"
|
|
25
21
|
},
|
|
26
|
-
"
|
|
27
|
-
"
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
22
|
+
"./styles/*.css": "./dist/styles/*.css",
|
|
23
|
+
"./style.css": "./dist/style.css"
|
|
24
|
+
},
|
|
25
|
+
"files": [
|
|
26
|
+
"dist"
|
|
27
|
+
],
|
|
28
|
+
"publishConfig": {
|
|
29
|
+
"access": "public"
|
|
30
|
+
},
|
|
31
|
+
"scripts": {
|
|
32
|
+
"test": "echo \"Error: no test specified\" && exit 1",
|
|
33
|
+
"build": "npm run build:manifest && vite build && npm run build:types && npm run build:assets",
|
|
34
|
+
"build:manifest": "node ./scripts/generate-component-manifest.mjs",
|
|
35
|
+
"build:types": "vue-tsc --project tsconfig.json --declaration --emitDeclarationOnly --outDir dist",
|
|
36
|
+
"build:assets": "node ./scripts/copy-style-assets.mjs",
|
|
37
|
+
"lint": "eslint .",
|
|
38
|
+
"lint:fix": "eslint . --fix",
|
|
39
|
+
"format": "prettier --write .",
|
|
40
|
+
"format:check": "prettier --check .",
|
|
41
|
+
"quality": "pnpm lint && pnpm type-check",
|
|
42
|
+
"type-check": "vue-tsc --noEmit",
|
|
43
|
+
"prepublishOnly": "npm run build"
|
|
44
|
+
},
|
|
45
|
+
"keywords": [
|
|
46
|
+
"vue",
|
|
47
|
+
"vue3",
|
|
48
|
+
"ui",
|
|
49
|
+
"components",
|
|
50
|
+
"vite",
|
|
51
|
+
"ctorforce"
|
|
52
|
+
],
|
|
53
|
+
"author": "",
|
|
54
|
+
"license": "ISC",
|
|
55
|
+
"peerDependencies": {
|
|
56
|
+
"vue": "^3.5.0"
|
|
57
|
+
},
|
|
58
|
+
"devDependencies": {
|
|
59
|
+
"@types/node": "^25.5.0",
|
|
60
|
+
"@vitejs/plugin-vue": "^6.0.5",
|
|
61
|
+
"typescript": "5.9.2",
|
|
62
|
+
"vite": "^8.0.1",
|
|
63
|
+
"vue-tsc": "^3.2.6"
|
|
64
|
+
}
|
|
39
65
|
}
|
package/dist/ctorforce-ui.css
DELETED
package/dist/ctorforce-ui.umd.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports,require(`vue`)):typeof define==`function`&&define.amd?define([`exports`,`vue`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.CtorforceUI={},e.Vue))})(this,function(e,t){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var n={class:`cf-button`};e.Button=((e,t)=>{let n=e.__vccOpts||e;for(let[e,r]of t)n[e]=r;return n})((0,t.defineComponent)({__name:`Button`,props:{type:{}},setup(e){return(e,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(`button`,n,[(0,t.renderSlot)(e.$slots,`default`,{},void 0,!0)]))}}),[[`__scopeId`,`data-v-cd24b49e`]])});
|