cosey 0.6.14 → 0.6.16

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.
@@ -32,7 +32,7 @@ var stdin_default = defineComponent({
32
32
  "onClick": () => copy(props.text || "")
33
33
  }, {
34
34
  default: () => [createVNode(stdin_default$2, {
35
- "name": copied ? "co:checkmark" : "co:copy",
35
+ "name": copied.value ? "co:checkmark" : "co:copy",
36
36
  "class": `${prefixCls.value}-icon`
37
37
  }, null)]
38
38
  });
@@ -1,4 +1,4 @@
1
- import { getHljs } from '../highlight/style/hljs.js';
1
+ import { getHljs } from '../highlight/highlight.style.js';
2
2
  import { getGlobalStyleHook } from '../theme/getGlobalStyleHook.js';
3
3
  import { getSimpleStyleHook } from '../theme/getSimpleStyleHook.js';
4
4
  import { getTruncateStyle } from '../style/mixins.js';
@@ -0,0 +1,28 @@
1
+ import hljs from 'highlight.js/lib/core';
2
+ import json from 'highlight.js/lib/languages/json';
3
+ import plaintext from 'highlight.js/lib/languages/plaintext';
4
+ import xml from 'highlight.js/lib/languages/xml';
5
+ import { ExtractPropTypes, PropType, SlotsType } from 'vue';
6
+ export { hljs };
7
+ type xml = 'xml' | 'html' | 'xhtml' | 'rss' | 'atom' | 'xjb' | 'xsd' | 'xsl' | 'plist' | 'wsf' | 'svg';
8
+ type json = 'json';
9
+ type js = 'javascript' | 'js' | 'jsx' | 'mjs' | 'cjs';
10
+ type ts = 'typescript' | 'ts' | 'tsx' | 'mts' | 'cts';
11
+ type plaintext = 'plaintext' | 'text' | 'txt';
12
+ export declare const highlightProps: {
13
+ code: {
14
+ type: StringConstructor;
15
+ };
16
+ lang: {
17
+ type: PropType<xml | json | js | ts | plaintext | "css" | "scss" | "less" | (string & {})>;
18
+ };
19
+ };
20
+ export type HighlightProps = ExtractPropTypes<typeof highlightProps>;
21
+ export interface HighlightSlots {
22
+ default: {};
23
+ }
24
+ export declare const highlightSlots: SlotsType<HighlightSlots>;
25
+ export interface HighlightEmits {
26
+ }
27
+ export interface HighlightExpose {
28
+ }
@@ -0,0 +1,30 @@
1
+ import hljs from 'highlight.js/lib/core';
2
+ export { default as hljs } from 'highlight.js/lib/core';
3
+ import typescript from 'highlight.js/lib/languages/typescript';
4
+ import javascript from 'highlight.js/lib/languages/javascript';
5
+ import json from 'highlight.js/lib/languages/json';
6
+ import plaintext from 'highlight.js/lib/languages/plaintext';
7
+ import xml from 'highlight.js/lib/languages/xml';
8
+ import css from 'highlight.js/lib/languages/css';
9
+ import scss from 'highlight.js/lib/languages/scss';
10
+ import less from 'highlight.js/lib/languages/less';
11
+
12
+ hljs.registerLanguage("typescript", typescript);
13
+ hljs.registerLanguage("javascript", javascript);
14
+ hljs.registerLanguage("json", json);
15
+ hljs.registerLanguage("plaintext", plaintext);
16
+ hljs.registerLanguage("xml", xml);
17
+ hljs.registerLanguage("css", css);
18
+ hljs.registerLanguage("scss", scss);
19
+ hljs.registerLanguage("less", less);
20
+ const highlightProps = {
21
+ code: {
22
+ type: String
23
+ },
24
+ lang: {
25
+ type: String
26
+ }
27
+ };
28
+ const highlightSlots = Object;
29
+
30
+ export { highlightProps, highlightSlots };
@@ -1,21 +1,16 @@
1
- import hljs from 'highlight.js/lib/core';
2
- import json from 'highlight.js/lib/languages/json';
3
- import plaintext from 'highlight.js/lib/languages/plaintext';
4
- import xml from 'highlight.js/lib/languages/xml';
5
- export { hljs };
6
- type xml = 'xml' | 'html' | 'xhtml' | 'rss' | 'atom' | 'xjb' | 'xsd' | 'xsl' | 'plist' | 'wsf' | 'svg';
7
- type json = 'json';
8
- type js = 'javascript' | 'js' | 'jsx' | 'mjs' | 'cjs';
9
- type ts = 'typescript' | 'ts' | 'tsx' | 'mts' | 'cts';
10
- type plaintext = 'plaintext' | 'text' | 'txt';
11
- export interface HighlightProps {
12
- code?: string;
13
- lang?: xml | json | js | ts | plaintext | 'css' | 'scss' | 'less' | (string & {});
14
- }
15
- export interface HighlightSlots {
16
- default?: (props: Record<string, never>) => any;
17
- }
18
- export interface HighlightEmits {
19
- }
20
- export interface HighlightExpose {
21
- }
1
+ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
2
+ code: {
3
+ type: StringConstructor;
4
+ };
5
+ lang: {
6
+ type: import("vue").PropType<("html" | "svg" | "xml" | "xhtml" | "rss" | "atom" | "xjb" | "xsd" | "xsl" | "plist" | "wsf") | "json" | ("javascript" | "js" | "jsx" | "mjs" | "cjs") | ("typescript" | "ts" | "tsx" | "mts" | "cts") | ("text" | "plaintext" | "txt") | "css" | "scss" | "less" | (string & {})>;
7
+ };
8
+ }>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
9
+ code: {
10
+ type: StringConstructor;
11
+ };
12
+ lang: {
13
+ type: import("vue").PropType<("html" | "svg" | "xml" | "xhtml" | "rss" | "atom" | "xjb" | "xsd" | "xsl" | "plist" | "wsf") | "json" | ("javascript" | "js" | "jsx" | "mjs" | "cjs") | ("typescript" | "ts" | "tsx" | "mts" | "cts") | ("text" | "plaintext" | "txt") | "css" | "scss" | "less" | (string & {})>;
14
+ };
15
+ }>> & Readonly<{}>, {}, import("vue").SlotsType<import("./highlight.api").HighlightSlots>, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
16
+ export default _default;
@@ -1,19 +1,38 @@
1
+ import { defineComponent, computed, createVNode } from 'vue';
2
+ import { highlightSlots, highlightProps } from './highlight.api.js';
3
+ import stdin_default$1 from './highlight.style.js';
4
+ import stdin_default$2 from '../copy/copy.js';
5
+ import { useComponentConfig } from '../config-provider/config-provider.api.js';
1
6
  import hljs from 'highlight.js/lib/core';
2
- export { default as hljs } from 'highlight.js/lib/core';
3
- import typescript from 'highlight.js/lib/languages/typescript';
4
- import javascript from 'highlight.js/lib/languages/javascript';
5
- import json from 'highlight.js/lib/languages/json';
6
- import plaintext from 'highlight.js/lib/languages/plaintext';
7
- import xml from 'highlight.js/lib/languages/xml';
8
- import css from 'highlight.js/lib/languages/css';
9
- import scss from 'highlight.js/lib/languages/scss';
10
- import less from 'highlight.js/lib/languages/less';
11
7
 
12
- hljs.registerLanguage("typescript", typescript);
13
- hljs.registerLanguage("javascript", javascript);
14
- hljs.registerLanguage("json", json);
15
- hljs.registerLanguage("plaintext", plaintext);
16
- hljs.registerLanguage("xml", xml);
17
- hljs.registerLanguage("css", css);
18
- hljs.registerLanguage("scss", scss);
19
- hljs.registerLanguage("less", less);
8
+ var stdin_default = defineComponent({
9
+ name: "CoHighlight",
10
+ props: highlightProps,
11
+ slots: highlightSlots,
12
+ setup(props) {
13
+ const {
14
+ prefixCls
15
+ } = useComponentConfig("highlight", props);
16
+ const {
17
+ hashId
18
+ } = stdin_default$1(prefixCls);
19
+ const highlightedCode = computed(() => hljs.highlight(props.code || "", {
20
+ language: props.lang || "txt"
21
+ }).value);
22
+ return () => {
23
+ return createVNode("div", {
24
+ "class": [hashId.value, prefixCls.value]
25
+ }, [createVNode("pre", null, [createVNode("code", {
26
+ "class": "hljs",
27
+ "innerHTML": highlightedCode.value
28
+ }, null)]), createVNode("div", {
29
+ "class": `${prefixCls.value}-copy`
30
+ }, [createVNode(stdin_default$2, {
31
+ "text": props.code,
32
+ "class": `${prefixCls.value}-copy`
33
+ }, null)])]);
34
+ };
35
+ }
36
+ });
37
+
38
+ export { stdin_default as default };
@@ -0,0 +1,6 @@
1
+ import { CSSObject } from '../cssinjs';
2
+ export declare function getHljs(): CSSObject;
3
+ declare const _default: (_prefixCls?: import("vue").ComputedRef<string> | string, themeManager?: import("../theme/theme-context").ThemeManager) => {
4
+ hashId: import("vue").Ref<string, string>;
5
+ };
6
+ export default _default;
@@ -1,3 +1,5 @@
1
+ import { getSimpleStyleHook } from '../theme/getSimpleStyleHook.js';
2
+
1
3
  function getHljs() {
2
4
  return {
3
5
  ".hljs": {
@@ -40,5 +42,31 @@ function getHljs() {
40
42
  }
41
43
  };
42
44
  }
45
+ var stdin_default = getSimpleStyleHook("CoHighlight", (token) => {
46
+ const { componentCls } = token;
47
+ return {
48
+ [componentCls]: {
49
+ position: "relative",
50
+ pre: {
51
+ padding: token.paddingSM,
52
+ overflow: "auto",
53
+ color: "#abb2bf",
54
+ background: "#282c34",
55
+ borderRadius: token.borderRadius
56
+ },
57
+ [`${componentCls}-copy`]: {
58
+ position: "absolute",
59
+ insetBlockStart: token.sizeXXS,
60
+ insetInlineEnd: token.sizeXXS,
61
+ zIndex: 10,
62
+ color: token.colorWhite,
63
+ "&:hover,&:active": {
64
+ color: `${token.colorWhite} !important`
65
+ }
66
+ },
67
+ ...getHljs()
68
+ }
69
+ };
70
+ });
43
71
 
44
- export { getHljs };
72
+ export { stdin_default as default, getHljs };
@@ -1,18 +1,37 @@
1
- export * from './highlight';
1
+ export * from './highlight.api';
2
2
  declare const _Highlight: {
3
- new (...args: any[]): import("vue").CreateComponentPublicInstanceWithMixins<Readonly<import("./highlight").HighlightProps> & Readonly<{}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, import("vue").PublicProps, {}, false, {}, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, {}, any, import("vue").ComponentProvideOptions, {
3
+ new (...args: any[]): import("vue").CreateComponentPublicInstanceWithMixins<Readonly<import("vue").ExtractPropTypes<{
4
+ code: {
5
+ type: StringConstructor;
6
+ };
7
+ lang: {
8
+ type: import("vue").PropType<("html" | "svg" | "xml" | "xhtml" | "rss" | "atom" | "xjb" | "xsd" | "xsl" | "plist" | "wsf") | "json" | ("javascript" | "js" | "jsx" | "mjs" | "cjs") | ("typescript" | "ts" | "tsx" | "mts" | "cts") | ("text" | "plaintext" | "txt") | "css" | "scss" | "less" | (string & {})>;
9
+ };
10
+ }>> & Readonly<{}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, import("vue").PublicProps, {}, true, {}, import("vue").SlotsType<import("./highlight.api").HighlightSlots>, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, {}, any, import("vue").ComponentProvideOptions, {
4
11
  P: {};
5
12
  B: {};
6
13
  D: {};
7
14
  C: {};
8
15
  M: {};
9
16
  Defaults: {};
10
- }, Readonly<import("./highlight").HighlightProps> & Readonly<{}>, {}, {}, {}, {}, {}>;
17
+ }, Readonly<import("vue").ExtractPropTypes<{
18
+ code: {
19
+ type: StringConstructor;
20
+ };
21
+ lang: {
22
+ type: import("vue").PropType<("html" | "svg" | "xml" | "xhtml" | "rss" | "atom" | "xjb" | "xsd" | "xsl" | "plist" | "wsf") | "json" | ("javascript" | "js" | "jsx" | "mjs" | "cjs") | ("typescript" | "ts" | "tsx" | "mts" | "cts") | ("text" | "plaintext" | "txt") | "css" | "scss" | "less" | (string & {})>;
23
+ };
24
+ }>> & Readonly<{}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, {}>;
11
25
  __isFragment?: never;
12
26
  __isTeleport?: never;
13
27
  __isSuspense?: never;
14
- } & import("vue").ComponentOptionsBase<Readonly<import("./highlight").HighlightProps> & Readonly<{}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, {}, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & (new () => {
15
- $slots: import("./highlight").HighlightSlots;
16
- }) & import("vue").Plugin;
28
+ } & import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<{
29
+ code: {
30
+ type: StringConstructor;
31
+ };
32
+ lang: {
33
+ type: import("vue").PropType<("html" | "svg" | "xml" | "xhtml" | "rss" | "atom" | "xjb" | "xsd" | "xsl" | "plist" | "wsf") | "json" | ("javascript" | "js" | "jsx" | "mjs" | "cjs") | ("typescript" | "ts" | "tsx" | "mts" | "cts") | ("text" | "plaintext" | "txt") | "css" | "scss" | "less" | (string & {})>;
34
+ };
35
+ }>> & Readonly<{}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, {}, {}, string, import("vue").SlotsType<import("./highlight.api").HighlightSlots>, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & import("vue").Plugin;
17
36
  export { _Highlight as Highlight };
18
37
  export default _Highlight;
@@ -1,5 +1,6 @@
1
1
  import { withInstall } from '../utils.js';
2
- import stdin_default$1 from './highlight.vue.js';
2
+ import stdin_default$1 from './highlight.js';
3
+ export { highlightProps, highlightSlots } from './highlight.api.js';
3
4
  export { default as hljs } from 'highlight.js/lib/core';
4
5
 
5
6
  const _Highlight = withInstall(stdin_default$1);
@@ -76,6 +76,7 @@ export { useFormDialogWidth } from './form-dialog/useFormDialogWidth.js';
76
76
  export { elFormDrawerExposeKeys, formDrawerProps } from './form-drawer/form-drawer.js';
77
77
  export { defaultFormListProps, formListEmits, formListExposeKeys, formListProps, formListSlots } from './form-list/form-list.api.js';
78
78
  export { defaultMapSizeColNumber, formQueryContextSymbol, formQueryEmits, formQueryProps, formQuerySlots } from './form-query/form-query.api.js';
79
+ export { highlightProps, highlightSlots } from './highlight/highlight.api.js';
79
80
  export { default as hljs } from 'highlight.js/lib/core';
80
81
  export { addIconifyIcon, iconifyIconsSets } from './iconify-icon/iconify-icon.js';
81
82
  export { imageCardEmits, imageCardProps, imageCardSlots } from './image-card/image-card.api.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cosey",
3
- "version": "0.6.14",
3
+ "version": "0.6.16",
4
4
  "description": "基于 Vue3 + vite 的后台管理系统框架",
5
5
  "type": "module",
6
6
  "main": "index.js",
@@ -1,10 +0,0 @@
1
- import { type HighlightProps, type HighlightSlots } from './highlight';
2
- type __VLS_Slots = HighlightSlots;
3
- declare const __VLS_component: import("vue").DefineComponent<HighlightProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<HighlightProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
4
- declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
5
- export default _default;
6
- type __VLS_WithSlots<T, S> = T & {
7
- new (): {
8
- $slots: S;
9
- };
10
- };
@@ -1,56 +0,0 @@
1
- import { defineComponent, computed, createElementBlock, openBlock, normalizeClass, unref, createElementVNode, createVNode } from 'vue';
2
- import './highlight.js';
3
- import stdin_default$1 from './style/index.js';
4
- import stdin_default$2 from '../copy/copy.js';
5
- import { useComponentConfig } from '../config-provider/config-provider.api.js';
6
- import hljs from 'highlight.js/lib/core';
7
-
8
- const _hoisted_1 = ["innerHTML"];
9
- var stdin_default = /* @__PURE__ */defineComponent({
10
- ...{
11
- name: "CoHighlight"
12
- },
13
- __name: "highlight",
14
- props: {
15
- code: {
16
- type: String,
17
- required: false
18
- },
19
- lang: {
20
- type: null,
21
- required: false
22
- }
23
- },
24
- setup(__props, {
25
- expose: __expose
26
- }) {
27
- const props = __props;
28
- const {
29
- prefixCls
30
- } = useComponentConfig("highlight", props);
31
- const {
32
- hashId
33
- } = stdin_default$1(prefixCls);
34
- const highlightedCode = computed(() => hljs.highlight(props.code || "", {
35
- language: props.lang || "txt"
36
- }).value);
37
- __expose();
38
- return (_ctx, _cache) => {
39
- return openBlock(), createElementBlock("div", {
40
- class: normalizeClass([unref(hashId), unref(prefixCls)])
41
- }, [createElementVNode("pre", null, [createElementVNode("code", {
42
- class: "hljs",
43
- innerHTML: highlightedCode.value
44
- }, null, 8, _hoisted_1)]), createElementVNode("div", {
45
- class: normalizeClass(`${unref(prefixCls)}-copy`)
46
- }, [createVNode(unref(stdin_default$2), {
47
- text: _ctx.code,
48
- class: normalizeClass(`${unref(prefixCls)}-copy`)
49
- }, null, 8, ["text", "class"])], 2
50
- /* CLASS */)], 2
51
- /* CLASS */);
52
- };
53
- }
54
- });
55
-
56
- export { stdin_default as default };
@@ -1,2 +0,0 @@
1
- import { type CSSObject } from '../../cssinjs';
2
- export declare function getHljs(): CSSObject;
@@ -1,4 +0,0 @@
1
- declare const _default: (_prefixCls?: import("vue").ComputedRef<string> | string, themeManager?: import("../../theme/theme-context").ThemeManager) => {
2
- hashId: import("vue").Ref<string, string>;
3
- };
4
- export default _default;
@@ -1,28 +0,0 @@
1
- import { getSimpleStyleHook } from '../../theme/getSimpleStyleHook.js';
2
- import { getHljs } from './hljs.js';
3
-
4
- var stdin_default = getSimpleStyleHook("CoHighlight", (token) => {
5
- const { componentCls } = token;
6
- return {
7
- [componentCls]: {
8
- position: "relative",
9
- pre: {
10
- padding: token.paddingSM,
11
- overflow: "auto",
12
- color: "#abb2bf",
13
- background: "#282c34",
14
- borderRadius: token.borderRadius
15
- },
16
- [`${componentCls}-copy`]: {
17
- position: "absolute",
18
- insetBlockStart: token.sizeXXS,
19
- insetInlineEnd: token.sizeXXS,
20
- zIndex: 10,
21
- color: token.colorWhite
22
- },
23
- ...getHljs()
24
- }
25
- };
26
- });
27
-
28
- export { stdin_default as default };