@ctorforce/ui 1.0.1 → 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.
@@ -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"}
@@ -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__ */ ((e, t) => {
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", {}, void 0, !0)]));
7
+ return (t, a) => (n(), e("button", i, [r(t.$slots, "default")]));
12
8
  }
13
- }), [["__scopeId", "data-v-cd24b49e"]]);
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"}
@@ -0,0 +1,2 @@
1
+ import './src/style.css';
2
+ export * from './src/components';
@@ -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"}
@@ -0,0 +1,5 @@
1
+ export type ComponentMeta = {
2
+ name: string;
3
+ styleFile: string | null;
4
+ };
5
+ export declare const componentManifest: ComponentMeta[];
@@ -0,0 +1,16 @@
1
+ type __VLS_Props = {
2
+ type?: 'primary' | 'default';
3
+ };
4
+ declare var __VLS_1: {};
5
+ type __VLS_Slots = {} & {
6
+ default?: (props: typeof __VLS_1) => any;
7
+ };
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>;
9
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
10
+ declare const _default: typeof __VLS_export;
11
+ export default _default;
12
+ type __VLS_WithSlots<T, S> = T & {
13
+ new (): {
14
+ $slots: S;
15
+ };
16
+ };
@@ -0,0 +1,2 @@
1
+ import Button from './Button.vue';
2
+ export { Button };
package/dist/style.css ADDED
@@ -0,0 +1 @@
1
+ .cf-button{border-radius:6px;padding:8px 16px}
@@ -0,0 +1,4 @@
1
+ .cf-button {
2
+ padding: 8px 16px;
3
+ border-radius: 6px;
4
+ }
package/package.json CHANGED
@@ -1,33 +1,65 @@
1
1
  {
2
- "name": "@ctorforce/ui",
3
- "version": "1.0.1",
4
- "description": "",
5
- "main": "./dist/ctorforce-ui.umd.js",
6
- "module": "./dist/ctorforce-ui.mjs",
7
- "exports": {
8
- ".": {
9
- "import": "./dist/ctorforce-ui.mjs",
10
- "require": "./dist/ctorforce-ui.umd.js"
11
- },
12
- "./style.css": "./dist/ctorforce-ui.css"
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"
13
16
  },
14
- "files": [
15
- "dist"
16
- ],
17
- "scripts": {
18
- "test": "echo \"Error: no test specified\" && exit 1",
19
- "build": "vite build",
20
- "type-check": "vue-tsc --noEmit",
21
- "prepublishOnly": "npm run build"
17
+ "./resolver": {
18
+ "types": "./dist/resolver.d.ts",
19
+ "import": "./dist/resolver.mjs",
20
+ "require": "./dist/resolver.cjs"
22
21
  },
23
- "keywords": [],
24
- "author": "",
25
- "license": "ISC",
26
- "devDependencies": {
27
- "@types/node": "^25.5.0",
28
- "@vitejs/plugin-vue": "^6.0.5",
29
- "typescript": "5.9.2",
30
- "vite": "^8.0.1",
31
- "vue-tsc": "^3.2.6"
32
- }
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
+ }
33
65
  }
@@ -1,2 +0,0 @@
1
- .cf-button[data-v-cd24b49e]{border-radius:6px;padding:8px 16px}
2
- /*$vite$:1*/
@@ -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`]])});