@haklex/rich-ext-code-snippet 0.0.79 → 0.0.81
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.mjs +394 -454
- package/dist/rich-ext-code-snippet.css +2 -1
- package/dist/static.mjs +5 -12
- package/dist/transformer-CCg3Ky-e.js +443 -0
- package/package.json +7 -7
- package/dist/CodeSnippetNode-BmRM_Ma7.js +0 -400
|
@@ -1 +1,2 @@
|
|
|
1
|
-
:root{--rc-text: #000;--rc-text-secondary: #27272a;--rc-text-tertiary: #71717a;--rc-text-quaternary: #a1a1aa;--rc-bg: #ffffff;--rc-bg-secondary: #fafafa;--rc-bg-tertiary: #f4f4f5;--rc-fill: #e8e8ec;--rc-fill-secondary: #eeeeef;--rc-fill-tertiary: #f4f4f6;--rc-fill-quaternary: #f9f9fa;--rc-border: #f4f4f5;--rc-accent: #2563eb;--rc-accent-light: #2563eb20;--rc-link: #2563eb;--rc-code-text: #3f3f46;--rc-code-bg: #f4f4f5;--rc-hr-border: #e4e4e7;--rc-quote-border: #2563eb;--rc-quote-bg: #eff6ff;--rc-alert-info: #006bb7;--rc-alert-warning: #cc5500;--rc-alert-tip: #11cc00;--rc-alert-caution: #cc0011;--rc-alert-important: #5500cc;--rc-max-width: 700px;--rc-shadow-top-bar: 0 8px 30px rgba(0, 0, 0, .12), 0 2px 8px rgba(0, 0, 0, .06);--rc-shadow-modal: 0 10px 15px -3px rgba(0,0,0,.1), 0 4px 6px -4px rgba(0,0,0,.1);--rc-shadow-menu: 0 1px 4px rgba(0,0,0,.04), 0 4px 16px rgba(0,0,0,.08);--rc-space-xs: 4px;--rc-space-sm: 8px;--rc-space-md: 16px;--rc-space-lg: 24px;--rc-space-xl: 32px;--rc-font-family-sans: "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, Helvetica, "noto sans sc", "hiragino sans gb", -apple-system, system-ui, sans-serif, Apple Color Emoji, Segoe UI Emoji, Not Color Emoji;--rc-font-family-serif: "Noto Serif CJK SC", "Source Han Serif SC", "Source Han Serif", "source-han-serif-sc", "Songti SC", STSong, "华文宋体", serif;--rc-font-mono: "SF Mono", SFMono-Regular, ui-monospace, "DejaVu Sans Mono", Menlo, Consolas, monospace;--rc-font-size-2xs: .625em;--rc-font-size-xs: .75em;--rc-font-size-sm: .8125em;--rc-font-size-md: .875em;--rc-font-size-lg: 1.25em;--rc-font-size-base: 16px;--rc-font-size-small: 14px;--rc-line-height: 1.7;--rc-line-height-tight: 1.4;--rc-font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, Helvetica, "noto sans sc", "hiragino sans gb", -apple-system, system-ui, sans-serif, Apple Color Emoji, Segoe UI Emoji, Not Color Emoji;--rc-radius-sm: 4px;--rc-radius-md: 8px;--rc-radius-lg: 12px}:root.dark{--rc-text: #fafafa;--rc-text-secondary: #a1a1aa;--rc-text-tertiary: #71717a;--rc-text-quaternary: #52525b;--rc-bg: #09090b;--rc-bg-secondary: #18181b;--rc-bg-tertiary: #27272a;--rc-fill: #2a2a2f;--rc-fill-secondary: #222226;--rc-fill-tertiary: #1b1b1f;--rc-fill-quaternary: #131316;--rc-border: #27272a;--rc-accent: #60a5fa;--rc-accent-light: #60a5fa20;--rc-link: #60a5fa;--rc-code-text: #e4e4e7;--rc-code-bg: #27272a;--rc-hr-border: #27272a;--rc-quote-border: #60a5fa;--rc-quote-bg: #1e3a5f;--rc-alert-info: #7db9e5;--rc-alert-warning: #da864a;--rc-alert-tip: #54da48;--rc-alert-caution: #e16973;--rc-alert-important: #9966e0;--rc-max-width: 700px;--rc-shadow-top-bar: 0 8px 30px rgba(0, 0, 0, .45), 0 2px 8px rgba(0, 0, 0, .3);--rc-shadow-modal: 0 10px 15px -3px rgba(0,0,0,.4), 0 4px 6px -4px rgba(0,0,0,.35);--rc-shadow-menu: 0 1px 4px rgba(0,0,0,.25), 0 4px 16px rgba(0,0,0,.4);--rc-space-xs: 4px;--rc-space-sm: 8px;--rc-space-md: 16px;--rc-space-lg: 24px;--rc-space-xl: 32px;--rc-font-family-sans: "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, Helvetica, "noto sans sc", "hiragino sans gb", -apple-system, system-ui, sans-serif, Apple Color Emoji, Segoe UI Emoji, Not Color Emoji;--rc-font-family-serif: "Noto Serif CJK SC", "Source Han Serif SC", "Source Han Serif", "source-han-serif-sc", "Songti SC", STSong, "华文宋体", serif;--rc-font-mono: "SF Mono", SFMono-Regular, ui-monospace, "DejaVu Sans Mono", Menlo, Consolas, monospace;--rc-font-size-2xs: .625em;--rc-font-size-xs: .75em;--rc-font-size-sm: .8125em;--rc-font-size-md: .875em;--rc-font-size-lg: 1.25em;--rc-font-size-base: 16px;--rc-font-size-small: 14px;--rc-line-height: 1.7;--rc-line-height-tight: 1.4;--rc-font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, Helvetica, "noto sans sc", "hiragino sans gb", -apple-system, system-ui, sans-serif, Apple Color Emoji, Segoe UI Emoji, Not Color Emoji;--rc-radius-sm: 4px;--rc-radius-md: 8px;--rc-radius-lg: 12px}._842nom0{--rc-text: #000;--rc-text-secondary: #27272a;--rc-text-tertiary: #71717a;--rc-text-quaternary: #a1a1aa;--rc-bg: #ffffff;--rc-bg-secondary: #fafafa;--rc-bg-tertiary: #f4f4f5;--rc-fill: #e8e8ec;--rc-fill-secondary: #eeeeef;--rc-fill-tertiary: #f4f4f6;--rc-fill-quaternary: #f9f9fa;--rc-border: #f4f4f5;--rc-accent: #2563eb;--rc-accent-light: #2563eb20;--rc-link: #2563eb;--rc-code-text: #3f3f46;--rc-code-bg: #f4f4f5;--rc-hr-border: #e4e4e7;--rc-quote-border: #2563eb;--rc-quote-bg: #eff6ff;--rc-alert-info: #006bb7;--rc-alert-warning: #cc5500;--rc-alert-tip: #11cc00;--rc-alert-caution: #cc0011;--rc-alert-important: #5500cc;--rc-max-width: 700px;--rc-shadow-top-bar: 0 8px 30px rgba(0, 0, 0, .12), 0 2px 8px rgba(0, 0, 0, .06);--rc-shadow-modal: 0 10px 15px -3px rgba(0,0,0,.1), 0 4px 6px -4px rgba(0,0,0,.1);--rc-shadow-menu: 0 1px 4px rgba(0,0,0,.04), 0 4px 16px rgba(0,0,0,.08);--rc-space-xs: 4px;--rc-space-sm: 8px;--rc-space-md: 16px;--rc-space-lg: 24px;--rc-space-xl: 32px;--rc-font-family-sans: "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, Helvetica, "noto sans sc", "hiragino sans gb", -apple-system, system-ui, sans-serif, Apple Color Emoji, Segoe UI Emoji, Not Color Emoji;--rc-font-family-serif: "Noto Serif CJK SC", "Source Han Serif SC", "Source Han Serif", "source-han-serif-sc", "Songti SC", STSong, "华文宋体", serif;--rc-font-mono: "SF Mono", SFMono-Regular, ui-monospace, "DejaVu Sans Mono", Menlo, Consolas, monospace;--rc-font-size-2xs: .625em;--rc-font-size-xs: .75em;--rc-font-size-sm: .8125em;--rc-font-size-md: .875em;--rc-font-size-lg: 1.25em;--rc-font-size-base: 16px;--rc-font-size-small: 14px;--rc-line-height: 1.7;--rc-line-height-tight: 1.4;--rc-font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, Helvetica, "noto sans sc", "hiragino sans gb", -apple-system, system-ui, sans-serif, Apple Color Emoji, Segoe UI Emoji, Not Color Emoji;--rc-radius-sm: 4px;--rc-radius-md: 8px;--rc-radius-lg: 12px}._842nom1{--rc-text: #000;--rc-text-secondary: #27272a;--rc-text-tertiary: #71717a;--rc-text-quaternary: #a1a1aa;--rc-bg: #ffffff;--rc-bg-secondary: #fafafa;--rc-bg-tertiary: #f4f4f5;--rc-fill: #e8e8ec;--rc-fill-secondary: #eeeeef;--rc-fill-tertiary: #f4f4f6;--rc-fill-quaternary: #f9f9fa;--rc-border: #f4f4f5;--rc-accent: #2563eb;--rc-accent-light: #2563eb20;--rc-link: #2563eb;--rc-code-text: #3f3f46;--rc-code-bg: #f4f4f5;--rc-hr-border: #e4e4e7;--rc-quote-border: #2563eb;--rc-quote-bg: #eff6ff;--rc-alert-info: #006bb7;--rc-alert-warning: #cc5500;--rc-alert-tip: #11cc00;--rc-alert-caution: #cc0011;--rc-alert-important: #5500cc;--rc-max-width: 700px;--rc-shadow-top-bar: 0 8px 30px rgba(0, 0, 0, .12), 0 2px 8px rgba(0, 0, 0, .06);--rc-shadow-modal: 0 10px 15px -3px rgba(0,0,0,.1), 0 4px 6px -4px rgba(0,0,0,.1);--rc-shadow-menu: 0 1px 4px rgba(0,0,0,.04), 0 4px 16px rgba(0,0,0,.08);--rc-space-xs: 4px;--rc-space-sm: 8px;--rc-space-md: 16px;--rc-space-lg: 24px;--rc-space-xl: 32px;--rc-font-family-sans: "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, Helvetica, "noto sans sc", "hiragino sans gb", -apple-system, system-ui, sans-serif, Apple Color Emoji, Segoe UI Emoji, Not Color Emoji;--rc-font-family-serif: "Noto Serif CJK SC", "Source Han Serif SC", "Source Han Serif", "source-han-serif-sc", "Songti SC", STSong, "华文宋体", serif;--rc-font-mono: "SF Mono", SFMono-Regular, ui-monospace, "DejaVu Sans Mono", Menlo, Consolas, monospace;--rc-font-size-2xs: .625em;--rc-font-size-xs: .75em;--rc-font-size-sm: .8125em;--rc-font-size-md: .875em;--rc-font-size-lg: 1.25em;--rc-font-size-base: 16px;--rc-font-size-small: 14px;--rc-line-height: 1.8;--rc-line-height-tight: 1.4;--rc-font-family: "Noto Serif CJK SC", "Source Han Serif SC", "Source Han Serif", "source-han-serif-sc", "Songti SC", STSong, "华文宋体", serif;--rc-radius-sm: 4px;--rc-radius-md: 8px;--rc-radius-lg: 12px}._842nom2{--rc-text: #000;--rc-text-secondary: #27272a;--rc-text-tertiary: #71717a;--rc-text-quaternary: #a1a1aa;--rc-bg: #ffffff;--rc-bg-secondary: #fafafa;--rc-bg-tertiary: #f4f4f5;--rc-fill: #e8e8ec;--rc-fill-secondary: #eeeeef;--rc-fill-tertiary: #f4f4f6;--rc-fill-quaternary: #f9f9fa;--rc-border: #f4f4f5;--rc-accent: #2563eb;--rc-accent-light: #2563eb20;--rc-link: #2563eb;--rc-code-text: #3f3f46;--rc-code-bg: #f4f4f5;--rc-hr-border: #e4e4e7;--rc-quote-border: #a1a1aa;--rc-quote-bg: #fafafa;--rc-alert-info: #006bb7;--rc-alert-warning: #cc5500;--rc-alert-tip: #11cc00;--rc-alert-caution: #cc0011;--rc-alert-important: #5500cc;--rc-max-width: none;--rc-shadow-top-bar: 0 8px 30px rgba(0, 0, 0, .12), 0 2px 8px rgba(0, 0, 0, .06);--rc-shadow-modal: 0 10px 15px -3px rgba(0,0,0,.1), 0 4px 6px -4px rgba(0,0,0,.1);--rc-shadow-menu: 0 1px 4px rgba(0,0,0,.04), 0 4px 16px rgba(0,0,0,.08);--rc-space-xs: 2px;--rc-space-sm: 4px;--rc-space-md: 10px;--rc-space-lg: 16px;--rc-space-xl: 20px;--rc-font-family-sans: "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, Helvetica, "noto sans sc", "hiragino sans gb", -apple-system, system-ui, sans-serif, Apple Color Emoji, Segoe UI Emoji, Not Color Emoji;--rc-font-family-serif: "Noto Serif CJK SC", "Source Han Serif SC", "Source Han Serif", "source-han-serif-sc", "Songti SC", STSong, "华文宋体", serif;--rc-font-mono: "SF Mono", SFMono-Regular, ui-monospace, "DejaVu Sans Mono", Menlo, Consolas, monospace;--rc-font-size-2xs: .625em;--rc-font-size-xs: .75em;--rc-font-size-sm: .8125em;--rc-font-size-md: .875em;--rc-font-size-lg: 1.25em;--rc-font-size-base: 14px;--rc-font-size-small: 12px;--rc-line-height: 1.5;--rc-line-height-tight: 1.3;--rc-font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, Helvetica, "noto sans sc", "hiragino sans gb", -apple-system, system-ui, sans-serif, Apple Color Emoji, Segoe UI Emoji, Not Color Emoji;--rc-radius-sm: 3px;--rc-radius-md: 6px;--rc-radius-lg: 12px}.dark ._842nom0,[data-theme=dark] ._842nom0,.dark._842nom0,[data-theme=dark]._842nom0,.dark ._842nom1,[data-theme=dark] ._842nom1,.dark._842nom1,[data-theme=dark]._842nom1,.dark ._842nom2,[data-theme=dark] ._842nom2,.dark._842nom2,[data-theme=dark]._842nom2{--rc-text: #fafafa;--rc-text-secondary: #a1a1aa;--rc-text-tertiary: #71717a;--rc-text-quaternary: #52525b;--rc-bg: #09090b;--rc-bg-secondary: #18181b;--rc-bg-tertiary: #27272a;--rc-fill: #2a2a2f;--rc-fill-secondary: #222226;--rc-fill-tertiary: #1b1b1f;--rc-fill-quaternary: #131316;--rc-border: #27272a;--rc-accent: #60a5fa;--rc-accent-light: #60a5fa20;--rc-link: #60a5fa;--rc-code-text: #e4e4e7;--rc-code-bg: #27272a;--rc-hr-border: #27272a;--rc-quote-border: #60a5fa;--rc-quote-bg: #1e3a5f;--rc-alert-info: #7db9e5;--rc-alert-warning: #da864a;--rc-alert-tip: #54da48;--rc-alert-caution: #e16973;--rc-alert-important: #9966e0;--rc-shadow-top-bar: 0 8px 30px rgba(0, 0, 0, .45), 0 2px 8px rgba(0, 0, 0, .3);--rc-shadow-modal: 0 10px 15px -3px rgba(0,0,0,.4), 0 4px 6px -4px rgba(0,0,0,.35);--rc-shadow-menu: 0 1px 4px rgba(0,0,0,.25), 0 4px 16px rgba(0,0,0,.4)}.hjkryc0{position:relative;border-radius:.5rem;overflow:hidden;border:1px solid color-mix(in srgb,var(--rc-border) 60%,transparent);background:var(--rc-code-bg);font-size:var(--rc-font-size-md)}.hjkryc1{display:flex;align-items:center;justify-content:space-between;padding:0 12px;min-height:40px}.hjkryc2{display:flex;align-items:center;gap:2px;overflow-x:auto;scrollbar-width:none}.hjkryc2::-webkit-scrollbar{display:none}.hjkryc3{display:flex;align-items:center;gap:6px;padding:6px 10px;font-size:var(--rc-font-size-xs);font-family:var(--rc-font-mono);font-weight:500;color:var(--rc-text-secondary);background:transparent;border:none;border-radius:6px;cursor:pointer;white-space:nowrap;flex-shrink:0;transition:color .15s,background .15s}.hjkryc3:hover{color:var(--rc-text);background:color-mix(in srgb,var(--rc-text) 5%,transparent)}.hjkryc5{color:var(--rc-text);background:var(--rc-fill)}.hjkryc7{display:flex;align-items:center;gap:6px;padding:6px 0;font-size:var(--rc-font-size-xs);font-family:var(--rc-font-mono);font-weight:500;color:var(--rc-text-secondary)}.hjkryc8{display:flex;align-items:center;opacity:0;transition:opacity .15s}.hjkryc0:hover .hjkryc8{opacity:1}.hjkryc9{display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;border-radius:6px;border:none;background:transparent;color:var(--rc-text-secondary);cursor:pointer;transition:background .15s,color .15s}.hjkryc9:hover{background:color-mix(in srgb,var(--rc-text) 8%,transparent);color:var(--rc-text)}.hjkryca{height:1px;background:var(--rc-border);opacity:.6}.hjkrycb{position:relative}.hjkrycc{display:grid;grid-template-rows:0fr;transition:grid-template-rows .3s ease}.hjkrycc[data-active=true]{grid-template-rows:1fr}.hjkrycd{overflow:hidden}.hjkrycc[data-active=true] .hjkrycd{overflow-x:auto}.hjkryce{padding:12px 16px;margin:0;font-size:var(--rc-font-size-small);line-height:1.7;font-family:var(--rc-font-mono)}.hjkryce pre{margin:0;background:transparent!important}.hjkryce code{font-family:inherit}[data-theme=dark] .hjkryce .shiki-themes,[data-theme=dark] .hjkryce .shiki-themes span{color:var(--shiki-dark)!important;font-style:var(--shiki-dark-font-style)!important;font-weight:var(--shiki-dark-font-weight)!important;text-decoration:var(--shiki-dark-text-decoration)!important}.hjkrycf{display:inline-flex;flex-shrink:0}.hjkrycf svg{width:100%;height:100%}.hjkrycg{position:relative}.hjkrych{position:absolute;inset:0;z-index:5;display:flex;align-items:center;justify-content:center;cursor:pointer;background:transparent;border:none}.hjkrych:hover{background:color-mix(in srgb,currentColor 6%,transparent)}.hjkryci{display:flex;align-items:center;gap:6px;padding:6px 14px;border-radius:6px;background:var(--rc-bg);border:1px solid var(--rc-border);color:var(--rc-text);font-size:var(--rc-font-size-sm);font-weight:500;opacity:0;transition:opacity .2s}.hjkrycg:hover .hjkryci{opacity:1}.hjkrycj.hjkrycj{padding:0;gap:0;display:flex;flex-direction:column;overflow:hidden;width:calc(100vw - 2rem);height:min(720px,80vh);border-radius:.75rem}.hjkrycj.hjkrycj[data-open],.hjkrycj.hjkrycj[data-closed]{animation:none}.hjkryck{display:flex;flex-direction:column;flex:1;min-height:0;overflow:hidden}.hjkrycl{display:flex;align-items:center;justify-content:space-between;height:44px;padding:0 16px;border-bottom:1px solid var(--rc-border);flex-shrink:0}.hjkrycm{font-size:var(--rc-font-size-xs);font-family:var(--rc-font-mono);color:var(--rc-text-secondary)}.hjkrycn{display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;border-radius:6px;border:none;background:transparent;color:var(--rc-text-secondary);cursor:pointer;transition:background .15s,color .15s}.hjkrycn:hover{background:color-mix(in srgb,var(--rc-text) 8%,transparent);color:var(--rc-text)}.hjkryco{display:flex;flex:1;min-height:0}.hjkrycp{width:224px;flex-shrink:0;border-right:1px solid var(--rc-border);display:flex;flex-direction:column;overflow:hidden}.hjkrycq{display:flex;align-items:center;justify-content:space-between;padding:12px 12px 8px;font-size:var(--rc-font-size-2xs);font-weight:600;text-transform:uppercase;letter-spacing:.05em;color:color-mix(in srgb,var(--rc-text-secondary) 60%,transparent)}.hjkrycr{display:inline-flex;align-items:center;justify-content:center;width:22px;height:22px;border-radius:4px;border:none;background:transparent;color:var(--rc-text-secondary);cursor:pointer;transition:background .15s,color .15s}.hjkrycr:hover{background:color-mix(in srgb,var(--rc-text) 8%,transparent);color:var(--rc-text)}.hjkrycs{flex:1;overflow-y:auto;padding:0 6px 8px}.hjkryct{display:flex;align-items:center;gap:4px;padding:4px 8px;border-radius:6px;height:24px;cursor:pointer;font-size:var(--rc-font-size-xs);font-family:var(--rc-font-mono);color:var(--rc-text-secondary);transition:background .15s,color .15s}.hjkryct:hover{background:color-mix(in srgb,var(--rc-text) 5%,transparent);color:var(--rc-text)}.hjkrycv{background:color-mix(in srgb,var(--rc-text) 8%,transparent);color:var(--rc-text)}.hjkrycx{opacity:.4}.hjkrycz{display:inline-flex;align-items:center;cursor:grab;color:color-mix(in srgb,var(--rc-text-secondary) 40%,transparent);flex-shrink:0;touch-action:none}.hjkrycz:active{cursor:grabbing}.hjkryc10{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.hjkryc11{display:none;align-items:center;justify-content:center;width:20px;height:20px;border-radius:4px;border:none;background:transparent;color:var(--rc-text-secondary);cursor:pointer;flex-shrink:0}.hjkryct:hover .hjkryc11{display:inline-flex}.hjkryc11:hover{color:var(--rc-alert-caution);background:color-mix(in srgb,var(--rc-alert-caution) 10%,transparent)}.hjkryc12{flex:1;min-width:0;padding:1px 4px;font-size:var(--rc-font-size-xs);font-family:var(--rc-font-mono);border-radius:3px;border:1px solid var(--rc-border);background:var(--rc-bg);color:var(--rc-text);outline:none}.hjkryc12:focus{border-color:color-mix(in srgb,var(--rc-text) 30%,transparent)}.hjkryc13{flex:1;display:flex;flex-direction:column;min-width:0}.hjkryc14{display:flex;align-items:center;justify-content:space-between;height:36px;padding:0 16px;border-bottom:1px solid color-mix(in srgb,var(--rc-border) 50%,transparent);flex-shrink:0}.hjkryc15{display:flex;align-items:center;gap:6px;font-size:var(--rc-font-size-xs);font-family:var(--rc-font-mono);color:var(--rc-text-secondary);overflow:hidden}.hjkryc16{color:var(--rc-text);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.hjkryc17{opacity:.5}.hjkryc18{flex:1;min-height:0;position:relative;overflow:auto;background-color:transparent!important}.hjkryc18 .cm-editor{height:100%;background:transparent;color:var(--rc-text);font-family:var(--rc-font-mono);font-size:var(--rc-font-size-sm)}.hjkryc18 .cm-scroller{font-family:var(--rc-font-mono)!important;line-height:1.7}.hjkryc18 .cm-content{padding-top:0;padding-bottom:0;padding-left:.5rem;padding-right:1rem;min-height:1.6em}.hjkryc18 .cm-line{padding:0}.hjkryc18 .cm-gutters{border-right:none;padding-left:1rem}.hjkryc18 .cm-lineNumbers .cm-gutterElement{min-width:3em;text-align:right;padding-right:2em;color:color-mix(in srgb,var(--rc-text-secondary) 40%,transparent)!important}.hjkryc19{background:var(--rc-fill-quaternary);border-radius:6px;box-shadow:var(--rc-shadow-modal)}@media(min-width:640px){.hjkrycj.hjkrycj{max-width:64rem}}
|
|
1
|
+
:root{--rc-text:#000;--rc-text-secondary:#27272a;--rc-text-tertiary:#71717a;--rc-text-quaternary:#a1a1aa;--rc-bg:#fff;--rc-bg-secondary:#fafafa;--rc-bg-tertiary:#f4f4f5;--rc-fill:#e8e8ec;--rc-fill-secondary:#eeeeef;--rc-fill-tertiary:#f4f4f6;--rc-fill-quaternary:#f9f9fa;--rc-border:#f4f4f5;--rc-accent:#2563eb;--rc-accent-light:#2563eb20;--rc-link:#2563eb;--rc-code-text:#3f3f46;--rc-code-bg:#f4f4f5;--rc-hr-border:#e4e4e7;--rc-quote-border:#2563eb;--rc-quote-bg:#eff6ff;--rc-alert-info:#006bb7;--rc-alert-warning:#c50;--rc-alert-tip:#1c0;--rc-alert-caution:#c01;--rc-alert-important:#50c;--rc-max-width:700px;--rc-shadow-top-bar:0 8px 30px #0000001f, 0 2px 8px #0000000f;--rc-shadow-modal:0 10px 15px -3px #0000001a, 0 4px 6px -4px #0000001a;--rc-shadow-menu:0 1px 4px #0000000a, 0 4px 16px #00000014;--rc-space-xs:4px;--rc-space-sm:8px;--rc-space-md:16px;--rc-space-lg:24px;--rc-space-xl:32px;--rc-font-family-sans:"PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, Helvetica, "noto sans sc", "hiragino sans gb", -apple-system, system-ui, sans-serif, Apple Color Emoji, Segoe UI Emoji, Not Color Emoji;--rc-font-family-serif:"Noto Serif CJK SC", "Source Han Serif SC", "Source Han Serif", "source-han-serif-sc", "Songti SC", STSong, "华文宋体", serif;--rc-font-mono:"SF Mono", SFMono-Regular, ui-monospace, "DejaVu Sans Mono", Menlo, Consolas, monospace;--rc-font-size-2xs:.625em;--rc-font-size-xs:.75em;--rc-font-size-sm:.8125em;--rc-font-size-md:.875em;--rc-font-size-lg:1.25em;--rc-font-size-base:16px;--rc-font-size-small:14px;--rc-line-height:1.7;--rc-line-height-tight:1.4;--rc-font-family:"PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, Helvetica, "noto sans sc", "hiragino sans gb", -apple-system, system-ui, sans-serif, Apple Color Emoji, Segoe UI Emoji, Not Color Emoji;--rc-radius-sm:4px;--rc-radius-md:8px;--rc-radius-lg:12px}:root.dark{--rc-text:#fafafa;--rc-text-secondary:#a1a1aa;--rc-text-tertiary:#71717a;--rc-text-quaternary:#52525b;--rc-bg:#09090b;--rc-bg-secondary:#18181b;--rc-bg-tertiary:#27272a;--rc-fill:#2a2a2f;--rc-fill-secondary:#222226;--rc-fill-tertiary:#1b1b1f;--rc-fill-quaternary:#131316;--rc-border:#27272a;--rc-accent:#60a5fa;--rc-accent-light:#60a5fa20;--rc-link:#60a5fa;--rc-code-text:#e4e4e7;--rc-code-bg:#27272a;--rc-hr-border:#27272a;--rc-quote-border:#60a5fa;--rc-quote-bg:#1e3a5f;--rc-alert-info:#7db9e5;--rc-alert-warning:#da864a;--rc-alert-tip:#54da48;--rc-alert-caution:#e16973;--rc-alert-important:#9966e0;--rc-max-width:700px;--rc-shadow-top-bar:0 8px 30px #00000073, 0 2px 8px #0000004d;--rc-shadow-modal:0 10px 15px -3px #0006, 0 4px 6px -4px #00000059;--rc-shadow-menu:0 1px 4px #00000040, 0 4px 16px #0006;--rc-space-xs:4px;--rc-space-sm:8px;--rc-space-md:16px;--rc-space-lg:24px;--rc-space-xl:32px;--rc-font-family-sans:"PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, Helvetica, "noto sans sc", "hiragino sans gb", -apple-system, system-ui, sans-serif, Apple Color Emoji, Segoe UI Emoji, Not Color Emoji;--rc-font-family-serif:"Noto Serif CJK SC", "Source Han Serif SC", "Source Han Serif", "source-han-serif-sc", "Songti SC", STSong, "华文宋体", serif;--rc-font-mono:"SF Mono", SFMono-Regular, ui-monospace, "DejaVu Sans Mono", Menlo, Consolas, monospace;--rc-font-size-2xs:.625em;--rc-font-size-xs:.75em;--rc-font-size-sm:.8125em;--rc-font-size-md:.875em;--rc-font-size-lg:1.25em;--rc-font-size-base:16px;--rc-font-size-small:14px;--rc-line-height:1.7;--rc-line-height-tight:1.4;--rc-font-family:"PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, Helvetica, "noto sans sc", "hiragino sans gb", -apple-system, system-ui, sans-serif, Apple Color Emoji, Segoe UI Emoji, Not Color Emoji;--rc-radius-sm:4px;--rc-radius-md:8px;--rc-radius-lg:12px}._842nom0{--rc-text:#000;--rc-text-secondary:#27272a;--rc-text-tertiary:#71717a;--rc-text-quaternary:#a1a1aa;--rc-bg:#fff;--rc-bg-secondary:#fafafa;--rc-bg-tertiary:#f4f4f5;--rc-fill:#e8e8ec;--rc-fill-secondary:#eeeeef;--rc-fill-tertiary:#f4f4f6;--rc-fill-quaternary:#f9f9fa;--rc-border:#f4f4f5;--rc-accent:#2563eb;--rc-accent-light:#2563eb20;--rc-link:#2563eb;--rc-code-text:#3f3f46;--rc-code-bg:#f4f4f5;--rc-hr-border:#e4e4e7;--rc-quote-border:#2563eb;--rc-quote-bg:#eff6ff;--rc-alert-info:#006bb7;--rc-alert-warning:#c50;--rc-alert-tip:#1c0;--rc-alert-caution:#c01;--rc-alert-important:#50c;--rc-max-width:700px;--rc-shadow-top-bar:0 8px 30px #0000001f, 0 2px 8px #0000000f;--rc-shadow-modal:0 10px 15px -3px #0000001a, 0 4px 6px -4px #0000001a;--rc-shadow-menu:0 1px 4px #0000000a, 0 4px 16px #00000014;--rc-space-xs:4px;--rc-space-sm:8px;--rc-space-md:16px;--rc-space-lg:24px;--rc-space-xl:32px;--rc-font-family-sans:"PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, Helvetica, "noto sans sc", "hiragino sans gb", -apple-system, system-ui, sans-serif, Apple Color Emoji, Segoe UI Emoji, Not Color Emoji;--rc-font-family-serif:"Noto Serif CJK SC", "Source Han Serif SC", "Source Han Serif", "source-han-serif-sc", "Songti SC", STSong, "华文宋体", serif;--rc-font-mono:"SF Mono", SFMono-Regular, ui-monospace, "DejaVu Sans Mono", Menlo, Consolas, monospace;--rc-font-size-2xs:.625em;--rc-font-size-xs:.75em;--rc-font-size-sm:.8125em;--rc-font-size-md:.875em;--rc-font-size-lg:1.25em;--rc-font-size-base:16px;--rc-font-size-small:14px;--rc-line-height:1.7;--rc-line-height-tight:1.4;--rc-font-family:"PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, Helvetica, "noto sans sc", "hiragino sans gb", -apple-system, system-ui, sans-serif, Apple Color Emoji, Segoe UI Emoji, Not Color Emoji;--rc-radius-sm:4px;--rc-radius-md:8px;--rc-radius-lg:12px}._842nom1{--rc-text:#000;--rc-text-secondary:#27272a;--rc-text-tertiary:#71717a;--rc-text-quaternary:#a1a1aa;--rc-bg:#fff;--rc-bg-secondary:#fafafa;--rc-bg-tertiary:#f4f4f5;--rc-fill:#e8e8ec;--rc-fill-secondary:#eeeeef;--rc-fill-tertiary:#f4f4f6;--rc-fill-quaternary:#f9f9fa;--rc-border:#f4f4f5;--rc-accent:#2563eb;--rc-accent-light:#2563eb20;--rc-link:#2563eb;--rc-code-text:#3f3f46;--rc-code-bg:#f4f4f5;--rc-hr-border:#e4e4e7;--rc-quote-border:#2563eb;--rc-quote-bg:#eff6ff;--rc-alert-info:#006bb7;--rc-alert-warning:#c50;--rc-alert-tip:#1c0;--rc-alert-caution:#c01;--rc-alert-important:#50c;--rc-max-width:700px;--rc-shadow-top-bar:0 8px 30px #0000001f, 0 2px 8px #0000000f;--rc-shadow-modal:0 10px 15px -3px #0000001a, 0 4px 6px -4px #0000001a;--rc-shadow-menu:0 1px 4px #0000000a, 0 4px 16px #00000014;--rc-space-xs:4px;--rc-space-sm:8px;--rc-space-md:16px;--rc-space-lg:24px;--rc-space-xl:32px;--rc-font-family-sans:"PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, Helvetica, "noto sans sc", "hiragino sans gb", -apple-system, system-ui, sans-serif, Apple Color Emoji, Segoe UI Emoji, Not Color Emoji;--rc-font-family-serif:"Noto Serif CJK SC", "Source Han Serif SC", "Source Han Serif", "source-han-serif-sc", "Songti SC", STSong, "华文宋体", serif;--rc-font-mono:"SF Mono", SFMono-Regular, ui-monospace, "DejaVu Sans Mono", Menlo, Consolas, monospace;--rc-font-size-2xs:.625em;--rc-font-size-xs:.75em;--rc-font-size-sm:.8125em;--rc-font-size-md:.875em;--rc-font-size-lg:1.25em;--rc-font-size-base:16px;--rc-font-size-small:14px;--rc-line-height:1.8;--rc-line-height-tight:1.4;--rc-font-family:"Noto Serif CJK SC", "Source Han Serif SC", "Source Han Serif", "source-han-serif-sc", "Songti SC", STSong, "华文宋体", serif;--rc-radius-sm:4px;--rc-radius-md:8px;--rc-radius-lg:12px}._842nom2{--rc-text:#000;--rc-text-secondary:#27272a;--rc-text-tertiary:#71717a;--rc-text-quaternary:#a1a1aa;--rc-bg:#fff;--rc-bg-secondary:#fafafa;--rc-bg-tertiary:#f4f4f5;--rc-fill:#e8e8ec;--rc-fill-secondary:#eeeeef;--rc-fill-tertiary:#f4f4f6;--rc-fill-quaternary:#f9f9fa;--rc-border:#f4f4f5;--rc-accent:#2563eb;--rc-accent-light:#2563eb20;--rc-link:#2563eb;--rc-code-text:#3f3f46;--rc-code-bg:#f4f4f5;--rc-hr-border:#e4e4e7;--rc-quote-border:#a1a1aa;--rc-quote-bg:#fafafa;--rc-alert-info:#006bb7;--rc-alert-warning:#c50;--rc-alert-tip:#1c0;--rc-alert-caution:#c01;--rc-alert-important:#50c;--rc-max-width:none;--rc-shadow-top-bar:0 8px 30px #0000001f, 0 2px 8px #0000000f;--rc-shadow-modal:0 10px 15px -3px #0000001a, 0 4px 6px -4px #0000001a;--rc-shadow-menu:0 1px 4px #0000000a, 0 4px 16px #00000014;--rc-space-xs:2px;--rc-space-sm:4px;--rc-space-md:10px;--rc-space-lg:16px;--rc-space-xl:20px;--rc-font-family-sans:"PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, Helvetica, "noto sans sc", "hiragino sans gb", -apple-system, system-ui, sans-serif, Apple Color Emoji, Segoe UI Emoji, Not Color Emoji;--rc-font-family-serif:"Noto Serif CJK SC", "Source Han Serif SC", "Source Han Serif", "source-han-serif-sc", "Songti SC", STSong, "华文宋体", serif;--rc-font-mono:"SF Mono", SFMono-Regular, ui-monospace, "DejaVu Sans Mono", Menlo, Consolas, monospace;--rc-font-size-2xs:.625em;--rc-font-size-xs:.75em;--rc-font-size-sm:.8125em;--rc-font-size-md:.875em;--rc-font-size-lg:1.25em;--rc-font-size-base:14px;--rc-font-size-small:12px;--rc-line-height:1.5;--rc-line-height-tight:1.3;--rc-font-family:"PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, Helvetica, "noto sans sc", "hiragino sans gb", -apple-system, system-ui, sans-serif, Apple Color Emoji, Segoe UI Emoji, Not Color Emoji;--rc-radius-sm:3px;--rc-radius-md:6px;--rc-radius-lg:12px}.dark ._842nom0,[data-theme=dark] ._842nom0,.dark._842nom0,[data-theme=dark]._842nom0,.dark ._842nom1,[data-theme=dark] ._842nom1,.dark._842nom1,[data-theme=dark]._842nom1,.dark ._842nom2,[data-theme=dark] ._842nom2,.dark._842nom2,[data-theme=dark]._842nom2{--rc-text:#fafafa;--rc-text-secondary:#a1a1aa;--rc-text-tertiary:#71717a;--rc-text-quaternary:#52525b;--rc-bg:#09090b;--rc-bg-secondary:#18181b;--rc-bg-tertiary:#27272a;--rc-fill:#2a2a2f;--rc-fill-secondary:#222226;--rc-fill-tertiary:#1b1b1f;--rc-fill-quaternary:#131316;--rc-border:#27272a;--rc-accent:#60a5fa;--rc-accent-light:#60a5fa20;--rc-link:#60a5fa;--rc-code-text:#e4e4e7;--rc-code-bg:#27272a;--rc-hr-border:#27272a;--rc-quote-border:#60a5fa;--rc-quote-bg:#1e3a5f;--rc-alert-info:#7db9e5;--rc-alert-warning:#da864a;--rc-alert-tip:#54da48;--rc-alert-caution:#e16973;--rc-alert-important:#9966e0;--rc-shadow-top-bar:0 8px 30px #00000073, 0 2px 8px #0000004d;--rc-shadow-modal:0 10px 15px -3px #0006, 0 4px 6px -4px #00000059;--rc-shadow-menu:0 1px 4px #00000040, 0 4px 16px #0006}.hjkryc0{border:1px solid color-mix(in srgb, var(--rc-border) 60%, transparent);background:var(--rc-code-bg);font-size:var(--rc-font-size-md);border-radius:.5rem;position:relative;overflow:hidden}.hjkryc1{justify-content:space-between;align-items:center;min-height:40px;padding:0 12px;display:flex}.hjkryc2{scrollbar-width:none;align-items:center;gap:2px;display:flex;overflow-x:auto}.hjkryc2::-webkit-scrollbar{display:none}.hjkryc3{font-size:var(--rc-font-size-xs);font-family:var(--rc-font-mono);color:var(--rc-text-secondary);cursor:pointer;white-space:nowrap;background:0 0;border:none;border-radius:6px;flex-shrink:0;align-items:center;gap:6px;padding:6px 10px;font-weight:500;transition:color .15s,background .15s;display:flex}.hjkryc3:hover{color:var(--rc-text);background:color-mix(in srgb, var(--rc-text) 5%, transparent)}.hjkryc5{color:var(--rc-text);background:var(--rc-fill)}.hjkryc7{font-size:var(--rc-font-size-xs);font-family:var(--rc-font-mono);color:var(--rc-text-secondary);align-items:center;gap:6px;padding:6px 0;font-weight:500;display:flex}.hjkryc8{opacity:0;align-items:center;transition:opacity .15s;display:flex}.hjkryc0:hover .hjkryc8{opacity:1}.hjkryc9{width:28px;height:28px;color:var(--rc-text-secondary);cursor:pointer;background:0 0;border:none;border-radius:6px;justify-content:center;align-items:center;transition:background .15s,color .15s;display:inline-flex}.hjkryc9:hover{background:color-mix(in srgb, var(--rc-text) 8%, transparent);color:var(--rc-text)}.hjkryca{background:var(--rc-border);opacity:.6;height:1px}.hjkrycb{position:relative}.hjkrycc{grid-template-rows:0fr;transition:grid-template-rows .3s;display:grid}.hjkrycc[data-active=true]{grid-template-rows:1fr}.hjkrycd{overflow:hidden}.hjkrycc[data-active=true] .hjkrycd{overflow-x:auto}.hjkryce{font-size:var(--rc-font-size-small);line-height:1.7;font-family:var(--rc-font-mono);margin:0;padding:12px 16px}.hjkryce pre{margin:0;background:0 0!important}.hjkryce code{font-family:inherit}[data-theme=dark] .hjkryce .shiki-themes,[data-theme=dark] .hjkryce .shiki-themes span{color:var(--shiki-dark)!important;font-style:var(--shiki-dark-font-style)!important;font-weight:var(--shiki-dark-font-weight)!important;-webkit-text-decoration:var(--shiki-dark-text-decoration)!important;text-decoration:var(--shiki-dark-text-decoration)!important}.hjkrycf{flex-shrink:0;display:inline-flex}.hjkrycf svg{width:100%;height:100%}.hjkrycg{position:relative}.hjkrych{z-index:5;cursor:pointer;background:0 0;border:none;justify-content:center;align-items:center;display:flex;position:absolute;top:0;bottom:0;left:0;right:0}.hjkrych:hover{background:color-mix(in srgb, currentColor 6%, transparent)}.hjkryci{background:var(--rc-bg);border:1px solid var(--rc-border);color:var(--rc-text);font-size:var(--rc-font-size-sm);opacity:0;border-radius:6px;align-items:center;gap:6px;padding:6px 14px;font-weight:500;transition:opacity .2s;display:flex}.hjkrycg:hover .hjkryci{opacity:1}.hjkrycj.hjkrycj{border-radius:.75rem;flex-direction:column;gap:0;width:calc(100vw - 2rem);height:min(720px,80vh);padding:0;display:flex;overflow:hidden}.hjkrycj.hjkrycj[data-open],.hjkrycj.hjkrycj[data-closed]{animation:none}.hjkryck{flex-direction:column;flex:1;min-height:0;display:flex;overflow:hidden}.hjkrycl{border-bottom:1px solid var(--rc-border);flex-shrink:0;justify-content:space-between;align-items:center;height:44px;padding:0 16px;display:flex}.hjkrycm{font-size:var(--rc-font-size-xs);font-family:var(--rc-font-mono);color:var(--rc-text-secondary)}.hjkrycn{width:28px;height:28px;color:var(--rc-text-secondary);cursor:pointer;background:0 0;border:none;border-radius:6px;justify-content:center;align-items:center;transition:background .15s,color .15s;display:inline-flex}.hjkrycn:hover{background:color-mix(in srgb, var(--rc-text) 8%, transparent);color:var(--rc-text)}.hjkryco{flex:1;min-height:0;display:flex}.hjkrycp{border-right:1px solid var(--rc-border);flex-direction:column;flex-shrink:0;width:224px;display:flex;overflow:hidden}.hjkrycq{font-size:var(--rc-font-size-2xs);text-transform:uppercase;letter-spacing:.05em;color:color-mix(in srgb, var(--rc-text-secondary) 60%, transparent);justify-content:space-between;align-items:center;padding:12px 12px 8px;font-weight:600;display:flex}.hjkrycr{width:22px;height:22px;color:var(--rc-text-secondary);cursor:pointer;background:0 0;border:none;border-radius:4px;justify-content:center;align-items:center;transition:background .15s,color .15s;display:inline-flex}.hjkrycr:hover{background:color-mix(in srgb, var(--rc-text) 8%, transparent);color:var(--rc-text)}.hjkrycs{flex:1;padding:0 6px 8px;overflow-y:auto}.hjkryct{cursor:pointer;height:24px;font-size:var(--rc-font-size-xs);font-family:var(--rc-font-mono);color:var(--rc-text-secondary);border-radius:6px;align-items:center;gap:4px;padding:4px 8px;transition:background .15s,color .15s;display:flex}.hjkryct:hover{background:color-mix(in srgb, var(--rc-text) 5%, transparent);color:var(--rc-text)}.hjkrycv{background:color-mix(in srgb, var(--rc-text) 8%, transparent);color:var(--rc-text)}.hjkrycx{opacity:.4}.hjkrycz{cursor:grab;color:color-mix(in srgb, var(--rc-text-secondary) 40%, transparent);touch-action:none;flex-shrink:0;align-items:center;display:inline-flex}.hjkrycz:active{cursor:grabbing}.hjkryc10{text-overflow:ellipsis;white-space:nowrap;flex:1;overflow:hidden}.hjkryc11{width:20px;height:20px;color:var(--rc-text-secondary);cursor:pointer;background:0 0;border:none;border-radius:4px;flex-shrink:0;justify-content:center;align-items:center;display:none}.hjkryct:hover .hjkryc11{display:inline-flex}.hjkryc11:hover{color:var(--rc-alert-caution);background:color-mix(in srgb, var(--rc-alert-caution) 10%, transparent)}.hjkryc12{min-width:0;font-size:var(--rc-font-size-xs);font-family:var(--rc-font-mono);border:1px solid var(--rc-border);background:var(--rc-bg);color:var(--rc-text);border-radius:3px;outline:none;flex:1;padding:1px 4px}.hjkryc12:focus{border-color:color-mix(in srgb, var(--rc-text) 30%, transparent)}.hjkryc13{flex-direction:column;flex:1;min-width:0;display:flex}.hjkryc14{border-bottom:1px solid color-mix(in srgb, var(--rc-border) 50%, transparent);flex-shrink:0;justify-content:space-between;align-items:center;height:36px;padding:0 16px;display:flex}.hjkryc15{font-size:var(--rc-font-size-xs);font-family:var(--rc-font-mono);color:var(--rc-text-secondary);align-items:center;gap:6px;display:flex;overflow:hidden}.hjkryc16{color:var(--rc-text);white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.hjkryc17{opacity:.5}.hjkryc18{flex:1;min-height:0;position:relative;overflow:auto;background-color:#0000!important}.hjkryc18 .cm-editor{height:100%;color:var(--rc-text);font-family:var(--rc-font-mono);font-size:var(--rc-font-size-sm);background:0 0}.hjkryc18 .cm-scroller{line-height:1.7;font-family:var(--rc-font-mono)!important}.hjkryc18 .cm-content{min-height:1.6em;padding:0 1rem 0 .5rem}.hjkryc18 .cm-line{padding:0}.hjkryc18 .cm-gutters{border-right:none;padding-left:1rem}.hjkryc18 .cm-lineNumbers .cm-gutterElement{text-align:right;min-width:3em;padding-right:2em;color:color-mix(in srgb, var(--rc-text-secondary) 40%, transparent)!important}.hjkryc19{background:var(--rc-fill-quaternary);box-shadow:var(--rc-shadow-modal);border-radius:6px}@media (min-width:640px){.hjkrycj.hjkrycj{max-width:64rem}}
|
|
2
|
+
/*$vite$:1*/
|
package/dist/static.mjs
CHANGED
|
@@ -1,12 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
export {
|
|
6
|
-
E as $createCodeSnippetNode,
|
|
7
|
-
$ as $isCodeSnippetNode,
|
|
8
|
-
CODE_SNIPPET_BLOCK_TRANSFORMER,
|
|
9
|
-
CodeSnippetNode,
|
|
10
|
-
C as CodeSnippetRenderer,
|
|
11
|
-
codeSnippetNodes
|
|
12
|
-
};
|
|
1
|
+
import { i as CodeSnippetNode, n as $createCodeSnippetNode, o as CodeSnippetRenderer, r as $isCodeSnippetNode, t as CODE_SNIPPET_BLOCK_TRANSFORMER } from "./transformer-CCg3Ky-e.js";
|
|
2
|
+
//#region src/static.ts
|
|
3
|
+
var codeSnippetNodes = [CodeSnippetNode];
|
|
4
|
+
//#endregion
|
|
5
|
+
export { $createCodeSnippetNode, $isCodeSnippetNode, CODE_SNIPPET_BLOCK_TRANSFORMER, CodeSnippetNode, CodeSnippetRenderer, codeSnippetNodes };
|
|
@@ -0,0 +1,443 @@
|
|
|
1
|
+
import { Check, Copy } from "lucide-react";
|
|
2
|
+
import { useCallback, useEffect, useRef, useState } from "react";
|
|
3
|
+
import { normalizeLanguage } from "@haklex/rich-renderer-codeblock/constants";
|
|
4
|
+
import { FileIcon } from "@haklex/rich-renderer-codeblock/icons";
|
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
import { SHIKI_DUAL_THEMES, getHighlighterWithLang } from "@haklex/rich-renderer-codeblock/shiki";
|
|
7
|
+
import { DecoratorNode } from "lexical";
|
|
8
|
+
import { createRendererDecoration } from "@haklex/rich-editor/renderers";
|
|
9
|
+
import { CODE_SNIPPET_BLOCK_TRANSFORMER } from "@haklex/rich-headless/transformers";
|
|
10
|
+
//#region ../../node_modules/.pnpm/@vanilla-extract+recipes@0.5.7_@vanilla-extract+css@1.18.0/node_modules/@vanilla-extract/recipes/dist/createRuntimeFn-62c9670f.esm.js
|
|
11
|
+
function toPrimitive$1(t, r) {
|
|
12
|
+
if ("object" != typeof t || !t) return t;
|
|
13
|
+
var e = t[Symbol.toPrimitive];
|
|
14
|
+
if (void 0 !== e) {
|
|
15
|
+
var i = e.call(t, r || "default");
|
|
16
|
+
if ("object" != typeof i) return i;
|
|
17
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
18
|
+
}
|
|
19
|
+
return ("string" === r ? String : Number)(t);
|
|
20
|
+
}
|
|
21
|
+
function toPropertyKey$1(t) {
|
|
22
|
+
var i = toPrimitive$1(t, "string");
|
|
23
|
+
return "symbol" == typeof i ? i : String(i);
|
|
24
|
+
}
|
|
25
|
+
function _defineProperty$1(obj, key, value) {
|
|
26
|
+
key = toPropertyKey$1(key);
|
|
27
|
+
if (key in obj) Object.defineProperty(obj, key, {
|
|
28
|
+
value,
|
|
29
|
+
enumerable: true,
|
|
30
|
+
configurable: true,
|
|
31
|
+
writable: true
|
|
32
|
+
});
|
|
33
|
+
else obj[key] = value;
|
|
34
|
+
return obj;
|
|
35
|
+
}
|
|
36
|
+
function ownKeys(e, r) {
|
|
37
|
+
var t = Object.keys(e);
|
|
38
|
+
if (Object.getOwnPropertySymbols) {
|
|
39
|
+
var o = Object.getOwnPropertySymbols(e);
|
|
40
|
+
r && (o = o.filter(function(r) {
|
|
41
|
+
return Object.getOwnPropertyDescriptor(e, r).enumerable;
|
|
42
|
+
})), t.push.apply(t, o);
|
|
43
|
+
}
|
|
44
|
+
return t;
|
|
45
|
+
}
|
|
46
|
+
function _objectSpread2(e) {
|
|
47
|
+
for (var r = 1; r < arguments.length; r++) {
|
|
48
|
+
var t = null != arguments[r] ? arguments[r] : {};
|
|
49
|
+
r % 2 ? ownKeys(Object(t), !0).forEach(function(r) {
|
|
50
|
+
_defineProperty$1(e, r, t[r]);
|
|
51
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function(r) {
|
|
52
|
+
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
return e;
|
|
56
|
+
}
|
|
57
|
+
function mapValues(input, fn) {
|
|
58
|
+
var result = {};
|
|
59
|
+
for (var _key in input) result[_key] = fn(input[_key], _key);
|
|
60
|
+
return result;
|
|
61
|
+
}
|
|
62
|
+
var shouldApplyCompound = (compoundCheck, selections, defaultVariants) => {
|
|
63
|
+
for (var key of Object.keys(compoundCheck)) {
|
|
64
|
+
var _selections$key;
|
|
65
|
+
if (compoundCheck[key] !== ((_selections$key = selections[key]) !== null && _selections$key !== void 0 ? _selections$key : defaultVariants[key])) return false;
|
|
66
|
+
}
|
|
67
|
+
return true;
|
|
68
|
+
};
|
|
69
|
+
var createRuntimeFn = (config) => {
|
|
70
|
+
var runtimeFn = (options) => {
|
|
71
|
+
var className = config.defaultClassName;
|
|
72
|
+
var selections = _objectSpread2(_objectSpread2({}, config.defaultVariants), options);
|
|
73
|
+
for (var variantName in selections) {
|
|
74
|
+
var _selections$variantNa;
|
|
75
|
+
var variantSelection = (_selections$variantNa = selections[variantName]) !== null && _selections$variantNa !== void 0 ? _selections$variantNa : config.defaultVariants[variantName];
|
|
76
|
+
if (variantSelection != null) {
|
|
77
|
+
var selection = variantSelection;
|
|
78
|
+
if (typeof selection === "boolean") selection = selection === true ? "true" : "false";
|
|
79
|
+
var selectionClassName = config.variantClassNames[variantName][selection];
|
|
80
|
+
if (selectionClassName) className += " " + selectionClassName;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
for (var [compoundCheck, compoundClassName] of config.compoundVariants) if (shouldApplyCompound(compoundCheck, selections, config.defaultVariants)) className += " " + compoundClassName;
|
|
84
|
+
return className;
|
|
85
|
+
};
|
|
86
|
+
runtimeFn.variants = () => Object.keys(config.variantClassNames);
|
|
87
|
+
runtimeFn.classNames = {
|
|
88
|
+
get base() {
|
|
89
|
+
return config.defaultClassName.split(" ")[0];
|
|
90
|
+
},
|
|
91
|
+
get variants() {
|
|
92
|
+
return mapValues(config.variantClassNames, (classNames) => mapValues(classNames, (className) => className.split(" ")[0]));
|
|
93
|
+
}
|
|
94
|
+
};
|
|
95
|
+
return runtimeFn;
|
|
96
|
+
};
|
|
97
|
+
//#endregion
|
|
98
|
+
//#region src/styles.css.ts
|
|
99
|
+
var semanticClassNames = {
|
|
100
|
+
container: "rcs-container",
|
|
101
|
+
header: "rcs-header",
|
|
102
|
+
tabs: "rcs-tabs",
|
|
103
|
+
tab: "rcs-tab",
|
|
104
|
+
tabActive: "rcs-tab-active",
|
|
105
|
+
titleBar: "rcs-title-bar",
|
|
106
|
+
headerActions: "rcs-header-actions",
|
|
107
|
+
copyButton: "rcs-copy-btn",
|
|
108
|
+
separator: "rcs-separator",
|
|
109
|
+
codePanelsWrapper: "rcs-code-panels-wrapper",
|
|
110
|
+
codePanel: "rcs-code-panel",
|
|
111
|
+
codeScroll: "rcs-code-scroll",
|
|
112
|
+
codeBody: "rcs-code-body",
|
|
113
|
+
fileIcon: "rcs-file-icon",
|
|
114
|
+
editContainer: "rcs-edit-container",
|
|
115
|
+
editOverlay: "rcs-edit-overlay",
|
|
116
|
+
editLabel: "rcs-edit-label",
|
|
117
|
+
modal: "rcs-modal",
|
|
118
|
+
modalTitlebar: "rcs-modal-titlebar",
|
|
119
|
+
modalTitle: "rcs-modal-title",
|
|
120
|
+
modalIconButton: "rcs-modal-icon-btn",
|
|
121
|
+
modalBody: "rcs-modal-body",
|
|
122
|
+
modalSidebar: "rcs-modal-sidebar",
|
|
123
|
+
sidebarHeader: "rcs-sidebar-header",
|
|
124
|
+
sidebarAddButton: "rcs-sidebar-add-btn",
|
|
125
|
+
fileList: "rcs-file-list",
|
|
126
|
+
fileItem: "rcs-file-item",
|
|
127
|
+
fileItemActive: "rcs-file-item-active",
|
|
128
|
+
fileItemDragging: "rcs-file-item-dragging",
|
|
129
|
+
fileDragHandle: "rcs-file-drag-handle",
|
|
130
|
+
fileName: "rcs-file-name",
|
|
131
|
+
fileDelete: "rcs-file-delete",
|
|
132
|
+
renameInput: "rcs-rename-input",
|
|
133
|
+
modalEditor: "rcs-modal-editor",
|
|
134
|
+
breadcrumb: "rcs-breadcrumb",
|
|
135
|
+
breadcrumbLeft: "rcs-breadcrumb-left",
|
|
136
|
+
breadcrumbName: "rcs-breadcrumb-name",
|
|
137
|
+
breadcrumbLang: "rcs-breadcrumb-lang",
|
|
138
|
+
editorContainer: "rcs-editor-container",
|
|
139
|
+
dragOverlay: "rcs-drag-overlay"
|
|
140
|
+
};
|
|
141
|
+
var container = "hjkryc0";
|
|
142
|
+
var header = "hjkryc1";
|
|
143
|
+
var tabs = "hjkryc2";
|
|
144
|
+
var tab = createRuntimeFn({
|
|
145
|
+
defaultClassName: "hjkryc4 hjkryc3",
|
|
146
|
+
variantClassNames: { active: {
|
|
147
|
+
true: "hjkryc5",
|
|
148
|
+
false: "hjkryc6"
|
|
149
|
+
} },
|
|
150
|
+
defaultVariants: { active: false },
|
|
151
|
+
compoundVariants: []
|
|
152
|
+
});
|
|
153
|
+
var titleBar = "hjkryc7";
|
|
154
|
+
var headerActions = "hjkryc8";
|
|
155
|
+
var copyButton = "hjkryc9";
|
|
156
|
+
var separator = "hjkryca";
|
|
157
|
+
var codePanelsWrapper = "hjkrycb";
|
|
158
|
+
var codePanel = "hjkrycc";
|
|
159
|
+
var codeScroll = "hjkrycd";
|
|
160
|
+
var codeBody = "hjkryce";
|
|
161
|
+
var fileIcon = "hjkrycf";
|
|
162
|
+
var editContainer = "hjkrycg";
|
|
163
|
+
var editOverlay = "hjkrych";
|
|
164
|
+
var editLabel = "hjkryci";
|
|
165
|
+
var codeSnippetDialogPopup = "hjkrycj";
|
|
166
|
+
var modal = "hjkryck";
|
|
167
|
+
var modalTitlebar = "hjkrycl";
|
|
168
|
+
var modalTitle = "hjkrycm";
|
|
169
|
+
var modalIconButton = "hjkrycn";
|
|
170
|
+
var modalBody = "hjkryco";
|
|
171
|
+
var modalSidebar = "hjkrycp";
|
|
172
|
+
var sidebarHeader = "hjkrycq";
|
|
173
|
+
var sidebarAddButton = "hjkrycr";
|
|
174
|
+
var fileList = "hjkrycs";
|
|
175
|
+
var fileItem = createRuntimeFn({
|
|
176
|
+
defaultClassName: "hjkrycu hjkryct",
|
|
177
|
+
variantClassNames: {
|
|
178
|
+
active: {
|
|
179
|
+
true: "hjkrycv",
|
|
180
|
+
false: "hjkrycw"
|
|
181
|
+
},
|
|
182
|
+
dragging: {
|
|
183
|
+
true: "hjkrycx",
|
|
184
|
+
false: "hjkrycy"
|
|
185
|
+
}
|
|
186
|
+
},
|
|
187
|
+
defaultVariants: {
|
|
188
|
+
active: false,
|
|
189
|
+
dragging: false
|
|
190
|
+
},
|
|
191
|
+
compoundVariants: []
|
|
192
|
+
});
|
|
193
|
+
var fileDragHandle = "hjkrycz";
|
|
194
|
+
var fileName = "hjkryc10";
|
|
195
|
+
var fileDelete = "hjkryc11";
|
|
196
|
+
var renameInput = "hjkryc12";
|
|
197
|
+
var modalEditor = "hjkryc13";
|
|
198
|
+
var breadcrumb = "hjkryc14";
|
|
199
|
+
var breadcrumbLeft = "hjkryc15";
|
|
200
|
+
var breadcrumbName = "hjkryc16";
|
|
201
|
+
var breadcrumbLang = "hjkryc17";
|
|
202
|
+
var editorContainer = "hjkryc18";
|
|
203
|
+
var dragOverlay = "hjkryc19";
|
|
204
|
+
//#endregion
|
|
205
|
+
//#region src/utils.ts
|
|
206
|
+
var EXT_TO_LANG = {
|
|
207
|
+
ts: "typescript",
|
|
208
|
+
tsx: "tsx",
|
|
209
|
+
js: "javascript",
|
|
210
|
+
jsx: "jsx",
|
|
211
|
+
py: "python",
|
|
212
|
+
rs: "rust",
|
|
213
|
+
go: "go",
|
|
214
|
+
java: "java",
|
|
215
|
+
html: "html",
|
|
216
|
+
css: "css",
|
|
217
|
+
scss: "scss",
|
|
218
|
+
json: "json",
|
|
219
|
+
md: "markdown",
|
|
220
|
+
sh: "bash",
|
|
221
|
+
yml: "yaml",
|
|
222
|
+
yaml: "yaml",
|
|
223
|
+
sql: "sql",
|
|
224
|
+
c: "c",
|
|
225
|
+
cpp: "cpp",
|
|
226
|
+
swift: "swift",
|
|
227
|
+
kt: "kotlin",
|
|
228
|
+
rb: "ruby",
|
|
229
|
+
php: "php",
|
|
230
|
+
vue: "vue",
|
|
231
|
+
svelte: "svelte",
|
|
232
|
+
toml: "toml",
|
|
233
|
+
xml: "xml",
|
|
234
|
+
graphql: "graphql",
|
|
235
|
+
gql: "graphql",
|
|
236
|
+
dockerfile: "dockerfile",
|
|
237
|
+
lua: "lua",
|
|
238
|
+
zig: "zig"
|
|
239
|
+
};
|
|
240
|
+
function getLanguageFromFilename(filename) {
|
|
241
|
+
return EXT_TO_LANG[filename.split(".").pop()?.toLowerCase() ?? ""] ?? "text";
|
|
242
|
+
}
|
|
243
|
+
//#endregion
|
|
244
|
+
//#region src/CodeSnippetRenderer.tsx
|
|
245
|
+
var CopyButton = ({ text }) => {
|
|
246
|
+
const [copied, setCopied] = useState(false);
|
|
247
|
+
const timerRef = useRef(void 0);
|
|
248
|
+
const handleCopy = useCallback(() => {
|
|
249
|
+
navigator.clipboard.writeText(text);
|
|
250
|
+
setCopied(true);
|
|
251
|
+
clearTimeout(timerRef.current);
|
|
252
|
+
timerRef.current = setTimeout(() => setCopied(false), 2e3);
|
|
253
|
+
}, [text]);
|
|
254
|
+
return /* @__PURE__ */ jsx("button", {
|
|
255
|
+
"aria-label": copied ? "Copied" : "Copy code",
|
|
256
|
+
className: `${copyButton} ${semanticClassNames.copyButton}`,
|
|
257
|
+
type: "button",
|
|
258
|
+
onClick: handleCopy,
|
|
259
|
+
children: copied ? /* @__PURE__ */ jsx(Check, { size: 14 }) : /* @__PURE__ */ jsx(Copy, { size: 14 })
|
|
260
|
+
});
|
|
261
|
+
};
|
|
262
|
+
var CodeSnippetRenderer = ({ files }) => {
|
|
263
|
+
const [activeIndex, setActiveIndex] = useState(0);
|
|
264
|
+
const [htmlMap, setHtmlMap] = useState({});
|
|
265
|
+
const activeFile = files[activeIndex] ?? files[0];
|
|
266
|
+
const isMultiFile = files.length > 1;
|
|
267
|
+
useEffect(() => {
|
|
268
|
+
let cancelled = false;
|
|
269
|
+
(async () => {
|
|
270
|
+
const newHtmlMap = {};
|
|
271
|
+
for (const file of files) {
|
|
272
|
+
const lang = normalizeLanguage(file.language ?? getLanguageFromFilename(file.filename));
|
|
273
|
+
const highlighter = await getHighlighterWithLang(lang);
|
|
274
|
+
if (cancelled) return;
|
|
275
|
+
const resolvedLang = highlighter.getLoadedLanguages().includes(lang) ? lang : "text";
|
|
276
|
+
newHtmlMap[file.filename] = highlighter.codeToHtml(file.code, {
|
|
277
|
+
lang: resolvedLang,
|
|
278
|
+
themes: SHIKI_DUAL_THEMES
|
|
279
|
+
});
|
|
280
|
+
}
|
|
281
|
+
if (!cancelled) setHtmlMap(newHtmlMap);
|
|
282
|
+
})();
|
|
283
|
+
return () => {
|
|
284
|
+
cancelled = true;
|
|
285
|
+
};
|
|
286
|
+
}, [files]);
|
|
287
|
+
if (!activeFile) return null;
|
|
288
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
289
|
+
"aria-label": "Code snippet",
|
|
290
|
+
className: `${container} ${semanticClassNames.container}`,
|
|
291
|
+
role: "region",
|
|
292
|
+
children: [
|
|
293
|
+
/* @__PURE__ */ jsxs("div", {
|
|
294
|
+
className: `${header} ${semanticClassNames.header}`,
|
|
295
|
+
children: [isMultiFile ? /* @__PURE__ */ jsx("div", {
|
|
296
|
+
"aria-label": "Code file tabs",
|
|
297
|
+
className: `${tabs} ${semanticClassNames.tabs}`,
|
|
298
|
+
role: "tablist",
|
|
299
|
+
children: files.map((file, index) => /* @__PURE__ */ jsxs("button", {
|
|
300
|
+
"aria-selected": index === activeIndex,
|
|
301
|
+
className: `${tab({ active: index === activeIndex })} ${semanticClassNames.tab} ${index === activeIndex ? semanticClassNames.tabActive : ""}`.trim(),
|
|
302
|
+
role: "tab",
|
|
303
|
+
type: "button",
|
|
304
|
+
onClick: () => setActiveIndex(index),
|
|
305
|
+
children: [/* @__PURE__ */ jsx(FileIcon, {
|
|
306
|
+
className: `${fileIcon} ${semanticClassNames.fileIcon}`,
|
|
307
|
+
filename: file.filename,
|
|
308
|
+
size: 14
|
|
309
|
+
}), /* @__PURE__ */ jsx("span", { children: file.filename })]
|
|
310
|
+
}, file.filename))
|
|
311
|
+
}) : /* @__PURE__ */ jsxs("div", {
|
|
312
|
+
className: `${titleBar} ${semanticClassNames.titleBar}`,
|
|
313
|
+
children: [/* @__PURE__ */ jsx(FileIcon, {
|
|
314
|
+
className: `${fileIcon} ${semanticClassNames.fileIcon}`,
|
|
315
|
+
filename: activeFile.filename,
|
|
316
|
+
size: 14
|
|
317
|
+
}), /* @__PURE__ */ jsx("span", { children: activeFile.filename })]
|
|
318
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
319
|
+
className: `${headerActions} ${semanticClassNames.headerActions}`,
|
|
320
|
+
children: /* @__PURE__ */ jsx(CopyButton, { text: activeFile.code })
|
|
321
|
+
})]
|
|
322
|
+
}),
|
|
323
|
+
/* @__PURE__ */ jsx("div", { className: `${separator} ${semanticClassNames.separator}` }),
|
|
324
|
+
/* @__PURE__ */ jsx("div", {
|
|
325
|
+
className: `${codePanelsWrapper} ${semanticClassNames.codePanelsWrapper}`,
|
|
326
|
+
children: files.map((file, index) => {
|
|
327
|
+
const html = htmlMap[file.filename];
|
|
328
|
+
return /* @__PURE__ */ jsx("div", {
|
|
329
|
+
className: `${codePanel} ${semanticClassNames.codePanel}`,
|
|
330
|
+
"data-active": index === activeIndex,
|
|
331
|
+
role: isMultiFile ? "tabpanel" : void 0,
|
|
332
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
333
|
+
className: `${codeScroll} ${semanticClassNames.codeScroll}`,
|
|
334
|
+
children: html ? /* @__PURE__ */ jsx("div", {
|
|
335
|
+
className: `${codeBody} ${semanticClassNames.codeBody}`,
|
|
336
|
+
dangerouslySetInnerHTML: { __html: html }
|
|
337
|
+
}) : /* @__PURE__ */ jsx("pre", {
|
|
338
|
+
className: `${codeBody} ${semanticClassNames.codeBody}`,
|
|
339
|
+
children: /* @__PURE__ */ jsx("code", { children: file.code.split("\n").map((line, i) => /* @__PURE__ */ jsx("span", {
|
|
340
|
+
className: "line",
|
|
341
|
+
children: line
|
|
342
|
+
}, i)) })
|
|
343
|
+
})
|
|
344
|
+
})
|
|
345
|
+
}, file.filename);
|
|
346
|
+
})
|
|
347
|
+
})
|
|
348
|
+
]
|
|
349
|
+
});
|
|
350
|
+
};
|
|
351
|
+
//#endregion
|
|
352
|
+
//#region \0@oxc-project+runtime@0.115.0/helpers/typeof.js
|
|
353
|
+
function _typeof(o) {
|
|
354
|
+
"@babel/helpers - typeof";
|
|
355
|
+
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
|
|
356
|
+
return typeof o;
|
|
357
|
+
} : function(o) {
|
|
358
|
+
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
|
|
359
|
+
}, _typeof(o);
|
|
360
|
+
}
|
|
361
|
+
//#endregion
|
|
362
|
+
//#region \0@oxc-project+runtime@0.115.0/helpers/toPrimitive.js
|
|
363
|
+
function toPrimitive(t, r) {
|
|
364
|
+
if ("object" != _typeof(t) || !t) return t;
|
|
365
|
+
var e = t[Symbol.toPrimitive];
|
|
366
|
+
if (void 0 !== e) {
|
|
367
|
+
var i = e.call(t, r || "default");
|
|
368
|
+
if ("object" != _typeof(i)) return i;
|
|
369
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
370
|
+
}
|
|
371
|
+
return ("string" === r ? String : Number)(t);
|
|
372
|
+
}
|
|
373
|
+
//#endregion
|
|
374
|
+
//#region \0@oxc-project+runtime@0.115.0/helpers/toPropertyKey.js
|
|
375
|
+
function toPropertyKey(t) {
|
|
376
|
+
var i = toPrimitive(t, "string");
|
|
377
|
+
return "symbol" == _typeof(i) ? i : i + "";
|
|
378
|
+
}
|
|
379
|
+
//#endregion
|
|
380
|
+
//#region \0@oxc-project+runtime@0.115.0/helpers/defineProperty.js
|
|
381
|
+
function _defineProperty(e, r, t) {
|
|
382
|
+
return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
383
|
+
value: t,
|
|
384
|
+
enumerable: !0,
|
|
385
|
+
configurable: !0,
|
|
386
|
+
writable: !0
|
|
387
|
+
}) : e[r] = t, e;
|
|
388
|
+
}
|
|
389
|
+
//#endregion
|
|
390
|
+
//#region src/nodes/CodeSnippetNode.ts
|
|
391
|
+
var CodeSnippetNode = class CodeSnippetNode extends DecoratorNode {
|
|
392
|
+
static getType() {
|
|
393
|
+
return "code-snippet";
|
|
394
|
+
}
|
|
395
|
+
static clone(node) {
|
|
396
|
+
return new CodeSnippetNode(node.__files, node.__key);
|
|
397
|
+
}
|
|
398
|
+
constructor(files, key) {
|
|
399
|
+
super(key);
|
|
400
|
+
_defineProperty(this, "__files", void 0);
|
|
401
|
+
this.__files = files;
|
|
402
|
+
}
|
|
403
|
+
createDOM(_config) {
|
|
404
|
+
const div = document.createElement("div");
|
|
405
|
+
div.className = "rich-code-snippet";
|
|
406
|
+
return div;
|
|
407
|
+
}
|
|
408
|
+
updateDOM() {
|
|
409
|
+
return false;
|
|
410
|
+
}
|
|
411
|
+
isInline() {
|
|
412
|
+
return false;
|
|
413
|
+
}
|
|
414
|
+
static importJSON(serializedNode) {
|
|
415
|
+
return $createCodeSnippetNode(serializedNode.files);
|
|
416
|
+
}
|
|
417
|
+
exportJSON() {
|
|
418
|
+
return {
|
|
419
|
+
...super.exportJSON(),
|
|
420
|
+
type: "code-snippet",
|
|
421
|
+
files: this.__files,
|
|
422
|
+
version: 1
|
|
423
|
+
};
|
|
424
|
+
}
|
|
425
|
+
getFiles() {
|
|
426
|
+
return this.getLatest().__files;
|
|
427
|
+
}
|
|
428
|
+
setFiles(files) {
|
|
429
|
+
const writable = this.getWritable();
|
|
430
|
+
writable.__files = files;
|
|
431
|
+
}
|
|
432
|
+
decorate(_editor, _config) {
|
|
433
|
+
return createRendererDecoration("CodeSnippet", CodeSnippetRenderer, { files: this.__files });
|
|
434
|
+
}
|
|
435
|
+
};
|
|
436
|
+
function $createCodeSnippetNode(files) {
|
|
437
|
+
return new CodeSnippetNode(files);
|
|
438
|
+
}
|
|
439
|
+
function $isCodeSnippetNode(node) {
|
|
440
|
+
return node instanceof CodeSnippetNode;
|
|
441
|
+
}
|
|
442
|
+
//#endregion
|
|
443
|
+
export { modalTitlebar as A, fileName as C, modalIconButton as D, modalEditor as E, semanticClassNames as M, sidebarAddButton as N, modalSidebar as O, sidebarHeader as P, fileList as S, modalBody as T, editorContainer as _, _defineProperty as a, fileIcon as b, breadcrumb as c, breadcrumbName as d, codeSnippetDialogPopup as f, editOverlay as g, editLabel as h, CodeSnippetNode as i, renameInput as j, modalTitle as k, breadcrumbLang as l, editContainer as m, $createCodeSnippetNode as n, CodeSnippetRenderer as o, dragOverlay as p, $isCodeSnippetNode as r, getLanguageFromFilename as s, CODE_SNIPPET_BLOCK_TRANSFORMER as t, breadcrumbLeft as u, fileDelete as v, modal as w, fileItem as x, fileDragHandle as y };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@haklex/rich-ext-code-snippet",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.81",
|
|
4
4
|
"description": "Multi-file code snippet extension",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -33,12 +33,12 @@
|
|
|
33
33
|
"@dnd-kit/utilities": "^3.2.2",
|
|
34
34
|
"lucide-react": "^0.577.0",
|
|
35
35
|
"shiki": "^4.0.1",
|
|
36
|
-
"@haklex/cm-editor": "0.0.
|
|
37
|
-
"@haklex/rich-editor": "0.0.
|
|
38
|
-
"@haklex/rich-editor
|
|
39
|
-
"@haklex/rich-
|
|
40
|
-
"@haklex/rich-
|
|
41
|
-
"@haklex/rich-style-token": "0.0.
|
|
36
|
+
"@haklex/cm-editor": "0.0.81",
|
|
37
|
+
"@haklex/rich-editor-ui": "0.0.81",
|
|
38
|
+
"@haklex/rich-editor": "0.0.81",
|
|
39
|
+
"@haklex/rich-renderer-codeblock": "0.0.81",
|
|
40
|
+
"@haklex/rich-headless": "0.0.81",
|
|
41
|
+
"@haklex/rich-style-token": "0.0.81"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"@lexical/react": "^0.41.0",
|