@ac-design/design-system 0.0.0-stage → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +160 -2
- package/dist/lib/compat.css +4441 -0
- package/dist/lib/components/AcAccordion.js +5 -0
- package/dist/lib/components/AcAccordion.vue.d.ts +35 -0
- package/dist/lib/components/AcAccordion.vue_vue_type_script_setup_true_lang.js +61 -0
- package/dist/lib/components/AcAccordionItem.js +5 -0
- package/dist/lib/components/AcAccordionItem.vue.d.ts +49 -0
- package/dist/lib/components/AcAccordionItem.vue_vue_type_script_setup_true_lang.js +81 -0
- package/dist/lib/components/AcAlert.js +5 -0
- package/dist/lib/components/AcAlert.vue.d.ts +52 -0
- package/dist/lib/components/AcAlert.vue_vue_type_script_setup_true_lang.js +121 -0
- package/dist/lib/components/AcAppSwitcher.js +5 -0
- package/dist/lib/components/AcAppSwitcher.vue.d.ts +83 -0
- package/dist/lib/components/AcAppSwitcher.vue_vue_type_script_setup_true_lang.js +303 -0
- package/dist/lib/components/AcAvatar.js +5 -0
- package/dist/lib/components/AcAvatar.vue.d.ts +27 -0
- package/dist/lib/components/AcAvatar.vue_vue_type_script_setup_true_lang.js +116 -0
- package/dist/lib/components/AcBadge.js +5 -0
- package/dist/lib/components/AcBadge.vue.d.ts +32 -0
- package/dist/lib/components/AcBadge.vue_vue_type_script_setup_true_lang.js +88 -0
- package/dist/lib/components/AcBanner.js +5 -0
- package/dist/lib/components/AcBanner.vue.d.ts +57 -0
- package/dist/lib/components/AcBanner.vue_vue_type_script_setup_true_lang.js +114 -0
- package/dist/lib/components/AcBreadcrumb.js +5 -0
- package/dist/lib/components/AcBreadcrumb.vue.d.ts +25 -0
- package/dist/lib/components/AcBreadcrumb.vue_vue_type_script_setup_true_lang.js +88 -0
- package/dist/lib/components/AcButton.js +5 -0
- package/dist/lib/components/AcButton.vue.d.ts +49 -0
- package/dist/lib/components/AcButton.vue_vue_type_script_setup_true_lang.js +103 -0
- package/dist/lib/components/AcButtons.js +5 -0
- package/dist/lib/components/AcButtons.vue.d.ts +31 -0
- package/dist/lib/components/AcButtons.vue_vue_type_script_setup_true_lang.js +44 -0
- package/dist/lib/components/AcCard.js +5 -0
- package/dist/lib/components/AcCard.vue.d.ts +27 -0
- package/dist/lib/components/AcCard.vue_vue_type_script_setup_true_lang.js +28 -0
- package/dist/lib/components/AcCellValue.js +5 -0
- package/dist/lib/components/AcCellValue.vue.d.ts +139 -0
- package/dist/lib/components/AcCellValue.vue_vue_type_script_setup_true_lang.js +386 -0
- package/dist/lib/components/AcCheckBox.js +5 -0
- package/dist/lib/components/AcCheckBox.vue.d.ts +31 -0
- package/dist/lib/components/AcCheckBox.vue_vue_type_script_setup_true_lang.js +49 -0
- package/dist/lib/components/AcCheckRadio.js +5 -0
- package/dist/lib/components/AcCheckRadio.vue.d.ts +35 -0
- package/dist/lib/components/AcCheckRadio.vue_vue_type_script_setup_true_lang.js +56 -0
- package/dist/lib/components/AcClusterSwitcher.js +5 -0
- package/dist/lib/components/AcClusterSwitcher.vue.d.ts +95 -0
- package/dist/lib/components/AcClusterSwitcher.vue_vue_type_script_setup_true_lang.js +416 -0
- package/dist/lib/components/AcCodeEditor.js +5 -0
- package/dist/lib/components/AcCodeEditor.vue.d.ts +88 -0
- package/dist/lib/components/AcCodeEditor.vue_vue_type_script_setup_true_lang.js +381 -0
- package/dist/lib/components/AcContentHeader.js +5 -0
- package/dist/lib/components/AcContentHeader.vue.d.ts +29 -0
- package/dist/lib/components/AcContentHeader.vue_vue_type_script_setup_true_lang.js +31 -0
- package/dist/lib/components/AcContentLayout.js +5 -0
- package/dist/lib/components/AcContentLayout.vue.d.ts +21 -0
- package/dist/lib/components/AcContentLayout.vue_vue_type_script_setup_true_lang.js +18 -0
- package/dist/lib/components/AcContentTable.js +5 -0
- package/dist/lib/components/AcContentTable.vue.d.ts +54 -0
- package/dist/lib/components/AcContentTable.vue_vue_type_script_setup_true_lang.js +67 -0
- package/dist/lib/components/AcDatePicker.js +5 -0
- package/dist/lib/components/AcDatePicker.vue.d.ts +88 -0
- package/dist/lib/components/AcDatePicker.vue_vue_type_script_setup_true_lang.js +794 -0
- package/dist/lib/components/AcDeleteModal.js +5 -0
- package/dist/lib/components/AcDeleteModal.vue.d.ts +51 -0
- package/dist/lib/components/AcDeleteModal.vue_vue_type_script_setup_true_lang.js +110 -0
- package/dist/lib/components/AcDivider.js +5 -0
- package/dist/lib/components/AcDivider.vue.d.ts +25 -0
- package/dist/lib/components/AcDivider.vue_vue_type_script_setup_true_lang.js +39 -0
- package/dist/lib/components/AcDropdown.js +5 -0
- package/dist/lib/components/AcDropdown.vue.d.ts +45 -0
- package/dist/lib/components/AcDropdown.vue_vue_type_script_setup_true_lang.js +152 -0
- package/dist/lib/components/AcDropdownDivider.js +5 -0
- package/dist/lib/components/AcDropdownDivider.vue.d.ts +9 -0
- package/dist/lib/components/AcDropdownDivider.vue_vue_type_script_setup_true_lang.js +20 -0
- package/dist/lib/components/AcDropdownItem.js +5 -0
- package/dist/lib/components/AcDropdownItem.vue.d.ts +50 -0
- package/dist/lib/components/AcDropdownItem.vue_vue_type_script_setup_true_lang.js +86 -0
- package/dist/lib/components/AcEmptyState.js +5 -0
- package/dist/lib/components/AcEmptyState.vue.d.ts +42 -0
- package/dist/lib/components/AcEmptyState.vue_vue_type_script_setup_true_lang.js +81 -0
- package/dist/lib/components/AcFeatureCard.js +5 -0
- package/dist/lib/components/AcFeatureCard.vue.d.ts +84 -0
- package/dist/lib/components/AcFeatureCard.vue_vue_type_script_setup_true_lang.js +218 -0
- package/dist/lib/components/AcFileEditor.js +5 -0
- package/dist/lib/components/AcFileEditor.vue.d.ts +95 -0
- package/dist/lib/components/AcFileEditor.vue_vue_type_script_setup_true_lang.js +556 -0
- package/dist/lib/components/AcFileUpload.js +5 -0
- package/dist/lib/components/AcFileUpload.vue.d.ts +67 -0
- package/dist/lib/components/AcFileUpload.vue_vue_type_script_setup_true_lang.js +274 -0
- package/dist/lib/components/AcFontScale.js +5 -0
- package/dist/lib/components/AcFontScale.vue.d.ts +17 -0
- package/dist/lib/components/AcFontScale.vue_vue_type_script_setup_true_lang.js +65 -0
- package/dist/lib/components/AcForm.js +5 -0
- package/dist/lib/components/AcForm.vue.d.ts +31 -0
- package/dist/lib/components/AcForm.vue_vue_type_script_setup_true_lang.js +38 -0
- package/dist/lib/components/AcFormArray.js +5 -0
- package/dist/lib/components/AcFormArray.vue.d.ts +124 -0
- package/dist/lib/components/AcFormArray.vue_vue_type_script_setup_true_lang.js +485 -0
- package/dist/lib/components/AcFormFooter.js +5 -0
- package/dist/lib/components/AcFormFooter.vue.d.ts +48 -0
- package/dist/lib/components/AcFormFooter.vue_vue_type_script_setup_true_lang.js +86 -0
- package/dist/lib/components/AcFormSection.js +5 -0
- package/dist/lib/components/AcFormSection.vue.d.ts +32 -0
- package/dist/lib/components/AcFormSection.vue_vue_type_script_setup_true_lang.js +38 -0
- package/dist/lib/components/AcHeader.js +5 -0
- package/dist/lib/components/AcHeader.vue.d.ts +46 -0
- package/dist/lib/components/AcHeader.vue_vue_type_script_setup_true_lang.js +60 -0
- package/dist/lib/components/AcHeaderItem.js +5 -0
- package/dist/lib/components/AcHeaderItem.vue.d.ts +13 -0
- package/dist/lib/components/AcHeaderItem.vue_vue_type_script_setup_true_lang.js +14 -0
- package/dist/lib/components/AcHeaderItems.js +5 -0
- package/dist/lib/components/AcHeaderItems.vue.d.ts +13 -0
- package/dist/lib/components/AcHeaderItems.vue_vue_type_script_setup_true_lang.js +14 -0
- package/dist/lib/components/AcInfoTable.js +5 -0
- package/dist/lib/components/AcInfoTable.vue.d.ts +59 -0
- package/dist/lib/components/AcInfoTable.vue_vue_type_script_setup_true_lang.js +127 -0
- package/dist/lib/components/AcInput.js +5 -0
- package/dist/lib/components/AcInput.vue.d.ts +68 -0
- package/dist/lib/components/AcInput.vue_vue_type_script_setup_true_lang.js +143 -0
- package/dist/lib/components/AcKbd.js +5 -0
- package/dist/lib/components/AcKbd.vue.d.ts +25 -0
- package/dist/lib/components/AcKbd.vue_vue_type_script_setup_true_lang.js +134 -0
- package/dist/lib/components/AcLogo.js +5 -0
- package/dist/lib/components/AcLogo.vue.d.ts +18 -0
- package/dist/lib/components/AcLogo.vue_vue_type_script_setup_true_lang.js +67 -0
- package/dist/lib/components/AcModal.js +5 -0
- package/dist/lib/components/AcModal.vue.d.ts +54 -0
- package/dist/lib/components/AcModal.vue_vue_type_script_setup_true_lang.js +125 -0
- package/dist/lib/components/AcNavbar.js +5 -0
- package/dist/lib/components/AcNavbar.vue.d.ts +41 -0
- package/dist/lib/components/AcNavbar.vue_vue_type_script_setup_true_lang.js +60 -0
- package/dist/lib/components/AcNavbarItem.js +5 -0
- package/dist/lib/components/AcNavbarItem.vue.d.ts +44 -0
- package/dist/lib/components/AcNavbarItem.vue_vue_type_script_setup_true_lang.js +65 -0
- package/dist/lib/components/AcNotificationMenu.js +5 -0
- package/dist/lib/components/AcNotificationMenu.vue.d.ts +90 -0
- package/dist/lib/components/AcNotificationMenu.vue_vue_type_script_setup_true_lang.js +345 -0
- package/dist/lib/components/AcPage.js +5 -0
- package/dist/lib/components/AcPage.vue.d.ts +25 -0
- package/dist/lib/components/AcPage.vue_vue_type_script_setup_true_lang.js +36 -0
- package/dist/lib/components/AcPagination.js +5 -0
- package/dist/lib/components/AcPagination.vue.d.ts +51 -0
- package/dist/lib/components/AcPagination.vue_vue_type_script_setup_true_lang.js +160 -0
- package/dist/lib/components/AcPreloader.js +5 -0
- package/dist/lib/components/AcPreloader.vue.d.ts +28 -0
- package/dist/lib/components/AcPreloader.vue_vue_type_script_setup_true_lang.js +39 -0
- package/dist/lib/components/AcProgress.js +5 -0
- package/dist/lib/components/AcProgress.vue.d.ts +31 -0
- package/dist/lib/components/AcProgress.vue_vue_type_script_setup_true_lang.js +76 -0
- package/dist/lib/components/AcResourceCard.js +5 -0
- package/dist/lib/components/AcResourceCard.vue.d.ts +106 -0
- package/dist/lib/components/AcResourceCard.vue_vue_type_script_setup_true_lang.js +203 -0
- package/dist/lib/components/AcSearchBar.js +5 -0
- package/dist/lib/components/AcSearchBar.vue.d.ts +41 -0
- package/dist/lib/components/AcSearchBar.vue_vue_type_script_setup_true_lang.js +76 -0
- package/dist/lib/components/AcSectionContent.js +5 -0
- package/dist/lib/components/AcSectionContent.vue.d.ts +55 -0
- package/dist/lib/components/AcSectionContent.vue_vue_type_script_setup_true_lang.js +74 -0
- package/dist/lib/components/AcSegmentedControl.js +5 -0
- package/dist/lib/components/AcSegmentedControl.vue.d.ts +46 -0
- package/dist/lib/components/AcSegmentedControl.vue_vue_type_script_setup_true_lang.js +104 -0
- package/dist/lib/components/AcSelect.js +5 -0
- package/dist/lib/components/AcSelect.vue.d.ts +78 -0
- package/dist/lib/components/AcSelect.vue_vue_type_script_setup_true_lang.js +441 -0
- package/dist/lib/components/AcSidePanel.js +5 -0
- package/dist/lib/components/AcSidePanel.vue.d.ts +57 -0
- package/dist/lib/components/AcSidePanel.vue_vue_type_script_setup_true_lang.js +128 -0
- package/dist/lib/components/AcSideTabs.js +5 -0
- package/dist/lib/components/AcSideTabs.vue.d.ts +93 -0
- package/dist/lib/components/AcSideTabs.vue_vue_type_script_setup_true_lang.js +373 -0
- package/dist/lib/components/AcSidebar.js +5 -0
- package/dist/lib/components/AcSidebar.vue.d.ts +63 -0
- package/dist/lib/components/AcSidebar.vue_vue_type_script_setup_true_lang.js +221 -0
- package/dist/lib/components/AcSidebarItem.js +5 -0
- package/dist/lib/components/AcSidebarItem.vue.d.ts +55 -0
- package/dist/lib/components/AcSidebarItem.vue_vue_type_script_setup_true_lang.js +155 -0
- package/dist/lib/components/AcSidebarSection.js +5 -0
- package/dist/lib/components/AcSidebarSection.vue.d.ts +32 -0
- package/dist/lib/components/AcSidebarSection.vue_vue_type_script_setup_true_lang.js +48 -0
- package/dist/lib/components/AcSkeleton.js +5 -0
- package/dist/lib/components/AcSkeleton.vue.d.ts +27 -0
- package/dist/lib/components/AcSkeleton.vue_vue_type_script_setup_true_lang.js +142 -0
- package/dist/lib/components/AcSlider.js +5 -0
- package/dist/lib/components/AcSlider.vue.d.ts +72 -0
- package/dist/lib/components/AcSlider.vue_vue_type_script_setup_true_lang.js +327 -0
- package/dist/lib/components/AcSpinner.js +5 -0
- package/dist/lib/components/AcSpinner.vue.d.ts +12 -0
- package/dist/lib/components/AcSpinner.vue_vue_type_script_setup_true_lang.js +45 -0
- package/dist/lib/components/AcStatCard.js +5 -0
- package/dist/lib/components/AcStatCard.vue.d.ts +84 -0
- package/dist/lib/components/AcStatCard.vue_vue_type_script_setup_true_lang.js +225 -0
- package/dist/lib/components/AcStatusBar.js +5 -0
- package/dist/lib/components/AcStatusBar.vue.d.ts +66 -0
- package/dist/lib/components/AcStatusBar.vue_vue_type_script_setup_true_lang.js +145 -0
- package/dist/lib/components/AcSteps.js +5 -0
- package/dist/lib/components/AcSteps.vue.d.ts +28 -0
- package/dist/lib/components/AcSteps.vue_vue_type_script_setup_true_lang.js +91 -0
- package/dist/lib/components/AcSwitch.js +5 -0
- package/dist/lib/components/AcSwitch.vue.d.ts +44 -0
- package/dist/lib/components/AcSwitch.vue_vue_type_script_setup_true_lang.js +67 -0
- package/dist/lib/components/AcTable.js +5 -0
- package/dist/lib/components/AcTable.vue.d.ts +98 -0
- package/dist/lib/components/AcTable.vue_vue_type_script_setup_true_lang.js +272 -0
- package/dist/lib/components/AcTabs.js +5 -0
- package/dist/lib/components/AcTabs.vue.d.ts +40 -0
- package/dist/lib/components/AcTabs.vue_vue_type_script_setup_true_lang.js +72 -0
- package/dist/lib/components/AcTag.js +5 -0
- package/dist/lib/components/AcTag.vue.d.ts +41 -0
- package/dist/lib/components/AcTag.vue_vue_type_script_setup_true_lang.js +99 -0
- package/dist/lib/components/AcTextarea.js +5 -0
- package/dist/lib/components/AcTextarea.vue.d.ts +53 -0
- package/dist/lib/components/AcTextarea.vue_vue_type_script_setup_true_lang.js +120 -0
- package/dist/lib/components/AcThemeMode.js +5 -0
- package/dist/lib/components/AcThemeMode.vue.d.ts +17 -0
- package/dist/lib/components/AcThemeMode.vue_vue_type_script_setup_true_lang.js +60 -0
- package/dist/lib/components/AcToaster.js +5 -0
- package/dist/lib/components/AcToaster.vue.d.ts +15 -0
- package/dist/lib/components/AcToaster.vue_vue_type_script_setup_true_lang.js +166 -0
- package/dist/lib/components/AcTooltip.js +5 -0
- package/dist/lib/components/AcTooltip.vue.d.ts +30 -0
- package/dist/lib/components/AcTooltip.vue_vue_type_script_setup_true_lang.js +117 -0
- package/dist/lib/components/AcUsageCard.js +5 -0
- package/dist/lib/components/AcUsageCard.vue.d.ts +85 -0
- package/dist/lib/components/AcUsageCard.vue_vue_type_script_setup_true_lang.js +230 -0
- package/dist/lib/components/AcUserMenu.js +5 -0
- package/dist/lib/components/AcUserMenu.vue.d.ts +77 -0
- package/dist/lib/components/AcUserMenu.vue_vue_type_script_setup_true_lang.js +258 -0
- package/dist/lib/components/index.d.ts +76 -0
- package/dist/lib/components/types.d.ts +16 -0
- package/dist/lib/composables/copyText.d.ts +6 -0
- package/dist/lib/composables/copyText.js +16 -0
- package/dist/lib/composables/useBrandColor.d.ts +53 -0
- package/dist/lib/composables/useBrandColor.js +148 -0
- package/dist/lib/composables/useColorMode.d.ts +12 -0
- package/dist/lib/composables/useColorMode.js +40 -0
- package/dist/lib/composables/useFontScale.d.ts +16 -0
- package/dist/lib/composables/useFontScale.js +43 -0
- package/dist/lib/composables/useToast.d.ts +68 -0
- package/dist/lib/composables/useToast.js +36 -0
- package/dist/lib/editor/index.d.ts +4 -0
- package/dist/lib/editor/index.js +3 -0
- package/dist/lib/editor/theme.d.ts +3 -0
- package/dist/lib/editor/theme.js +309 -0
- package/dist/lib/editor/validate.d.ts +19 -0
- package/dist/lib/editor/validate.js +127 -0
- package/dist/lib/index.d.ts +29 -0
- package/dist/lib/index.js +78 -0
- package/dist/lib/theme.css +556 -0
- package/package.json +82 -4
|
@@ -0,0 +1,556 @@
|
|
|
1
|
+
import e from "./AcButton.js";
|
|
2
|
+
import t from "./AcSkeleton.js";
|
|
3
|
+
import n from "./AcSearchBar.js";
|
|
4
|
+
import r from "./AcEmptyState.js";
|
|
5
|
+
import i from "./AcSelect.js";
|
|
6
|
+
import a from "./AcSegmentedControl.js";
|
|
7
|
+
import o from "./AcCodeEditor.js";
|
|
8
|
+
import { Fragment as s, computed as c, createBlock as l, createCommentVNode as u, createElementBlock as d, createElementVNode as f, createTextVNode as p, createVNode as m, defineComponent as h, mergeModels as g, nextTick as _, normalizeClass as v, normalizeStyle as ee, onBeforeUnmount as te, openBlock as y, ref as b, renderList as ne, renderSlot as re, resolveDynamicComponent as ie, shallowRef as ae, toDisplayString as x, unref as S, useId as oe, useModel as C, watch as w, withCtx as T } from "vue";
|
|
9
|
+
import { CircleAlert as se, Download as ce, Eye as le, EyeOff as ue, FileBraces as de, FileCode as fe, FileLock as pe, FileTerminal as me, FileText as he, Lock as ge, TriangleAlert as _e } from "@lucide/vue";
|
|
10
|
+
import { Text as ve } from "@codemirror/state";
|
|
11
|
+
//#region src/lib/components/AcFileEditor.vue?vue&type=script&setup=true&lang.ts
|
|
12
|
+
var ye = ["aria-busy"], be = {
|
|
13
|
+
key: 0,
|
|
14
|
+
class: "flex h-full flex-col @2xl:flex-row"
|
|
15
|
+
}, xe = {
|
|
16
|
+
class: "hidden w-60 shrink-0 flex-col gap-1 border-r border-border-light bg-surface-muted p-2 @2xl:flex @4xl:w-72",
|
|
17
|
+
"aria-hidden": "true"
|
|
18
|
+
}, Se = { class: "flex min-w-0 flex-1 flex-col gap-1.5" }, Ce = {
|
|
19
|
+
class: "border-b border-border-light p-2 @2xl:hidden",
|
|
20
|
+
"aria-hidden": "true"
|
|
21
|
+
}, we = {
|
|
22
|
+
key: 1,
|
|
23
|
+
class: "flex h-full items-center justify-center overflow-auto"
|
|
24
|
+
}, Te = {
|
|
25
|
+
key: 2,
|
|
26
|
+
class: "flex h-full flex-col @2xl:flex-row"
|
|
27
|
+
}, Ee = { class: "hidden w-60 shrink-0 flex-col border-r border-border-light bg-surface-muted @2xl:flex @4xl:w-72" }, De = ["aria-label"], Oe = [
|
|
28
|
+
"aria-selected",
|
|
29
|
+
"tabindex",
|
|
30
|
+
"title",
|
|
31
|
+
"onClick",
|
|
32
|
+
"onKeydown"
|
|
33
|
+
], ke = { class: "flex min-w-0 flex-1 flex-col" }, Ae = { class: "truncate text-base leading-5 font-medium" }, je = {
|
|
34
|
+
key: 0,
|
|
35
|
+
class: "truncate text-xs leading-4 text-muted"
|
|
36
|
+
}, Me = {
|
|
37
|
+
key: 1,
|
|
38
|
+
class: "size-2 shrink-0 rounded-full bg-primary",
|
|
39
|
+
"aria-hidden": "true"
|
|
40
|
+
}, Ne = {
|
|
41
|
+
key: 2,
|
|
42
|
+
class: "sr-only"
|
|
43
|
+
}, Pe = {
|
|
44
|
+
key: 2,
|
|
45
|
+
class: "min-h-0 flex-1 overflow-auto"
|
|
46
|
+
}, Fe = { class: "border-t border-border-light px-3 py-2 text-xs text-muted" }, Ie = { class: "text-red-40" }, Le = { class: "border-b border-border-light bg-surface-muted p-2 @2xl:hidden" }, Re = ["aria-label"], ze = {
|
|
47
|
+
key: 0,
|
|
48
|
+
class: "border-b border-yellow-90 bg-yellow-97 px-3 py-2 text-xs text-yellow-10"
|
|
49
|
+
}, Be = { class: "flex min-h-11 flex-wrap items-center gap-x-3 gap-y-1.5 border-b border-border-light px-3 py-2" }, Ve = { class: "min-w-0 truncate font-mono text-xs font-medium text-heading" }, He = { class: "inline-flex items-center gap-1 rounded-4 bg-surface-sunken px-1.5 text-sm leading-5 font-medium text-muted" }, Ue = { class: "ml-auto flex min-w-0 flex-wrap items-center justify-end gap-2" }, We = { class: "flex min-h-0 flex-1 items-center justify-center overflow-auto bg-surface-muted" }, Ge = ["aria-label"], Ke = /*@__PURE__*/ h({
|
|
50
|
+
__name: "AcFileEditor",
|
|
51
|
+
props: /*@__PURE__*/ g({
|
|
52
|
+
loading: {
|
|
53
|
+
type: Boolean,
|
|
54
|
+
default: !1
|
|
55
|
+
},
|
|
56
|
+
readonly: {
|
|
57
|
+
type: Boolean,
|
|
58
|
+
default: !1
|
|
59
|
+
},
|
|
60
|
+
height: { default: "480px" },
|
|
61
|
+
searchable: {
|
|
62
|
+
type: [Boolean, String],
|
|
63
|
+
default: "auto"
|
|
64
|
+
},
|
|
65
|
+
formatSwitch: {
|
|
66
|
+
type: Boolean,
|
|
67
|
+
default: !1
|
|
68
|
+
},
|
|
69
|
+
validate: {
|
|
70
|
+
type: Boolean,
|
|
71
|
+
default: !0
|
|
72
|
+
},
|
|
73
|
+
copyable: {
|
|
74
|
+
type: Boolean,
|
|
75
|
+
default: !0
|
|
76
|
+
},
|
|
77
|
+
downloadable: {
|
|
78
|
+
type: Boolean,
|
|
79
|
+
default: !1
|
|
80
|
+
},
|
|
81
|
+
wrap: {
|
|
82
|
+
type: Boolean,
|
|
83
|
+
default: !0
|
|
84
|
+
},
|
|
85
|
+
label: { default: "Files" },
|
|
86
|
+
emptyText: { default: "No files to show" }
|
|
87
|
+
}, {
|
|
88
|
+
files: { default: () => [] },
|
|
89
|
+
filesModifiers: {},
|
|
90
|
+
active: { default: "" },
|
|
91
|
+
activeModifiers: {},
|
|
92
|
+
search: { default: "" },
|
|
93
|
+
searchModifiers: {},
|
|
94
|
+
format: { default: "yaml" },
|
|
95
|
+
formatModifiers: {},
|
|
96
|
+
view: { default: "edit" },
|
|
97
|
+
viewModifiers: {}
|
|
98
|
+
}),
|
|
99
|
+
emits: /*@__PURE__*/ g(["validate", "download"], [
|
|
100
|
+
"update:files",
|
|
101
|
+
"update:active",
|
|
102
|
+
"update:search",
|
|
103
|
+
"update:format",
|
|
104
|
+
"update:view"
|
|
105
|
+
]),
|
|
106
|
+
setup(h, { expose: g, emit: Ke }) {
|
|
107
|
+
let E = h, D = C(h, "files"), O = C(h, "active"), k = C(h, "search"), qe = C(h, "format"), Je = C(h, "view"), Ye = Ke, Xe = [
|
|
108
|
+
"70%",
|
|
109
|
+
"55%",
|
|
110
|
+
"80%",
|
|
111
|
+
"45%",
|
|
112
|
+
"65%",
|
|
113
|
+
"50%",
|
|
114
|
+
"75%"
|
|
115
|
+
], Ze = {
|
|
116
|
+
yaml: fe,
|
|
117
|
+
json: de,
|
|
118
|
+
shell: me,
|
|
119
|
+
text: he
|
|
120
|
+
}, Qe = {
|
|
121
|
+
yaml: "yaml",
|
|
122
|
+
yml: "yaml",
|
|
123
|
+
json: "json",
|
|
124
|
+
sh: "shell",
|
|
125
|
+
bash: "shell"
|
|
126
|
+
}, $e, et = () => $e ??= import("../editor/validate.js"), tt = `${oe()}-pane`, nt = b(), A = b(), j = b(), M = /* @__PURE__ */ new Map(), N = ae(), P = b(!1), F = b(null), I = b(null), L = b(null), R = c(() => D.value.find((e) => e.name === O.value)), rt = c(() => E.searchable === "auto" ? D.value.length > 8 : E.searchable), z = c(() => {
|
|
127
|
+
let e = k.value.trim().toLowerCase();
|
|
128
|
+
return e ? D.value.filter((t) => [
|
|
129
|
+
t.name,
|
|
130
|
+
t.kind,
|
|
131
|
+
t.description,
|
|
132
|
+
t.secret ? "" : t.content
|
|
133
|
+
].some((t) => t?.toLowerCase().includes(e))) : D.value;
|
|
134
|
+
}), B = c(() => z.value.some((e) => e.name === O.value) ? O.value : z.value[0]?.name), V = c(() => {
|
|
135
|
+
let e = R.value;
|
|
136
|
+
if (!e) return null;
|
|
137
|
+
let t = W(e), n = G(e, e.content), r = n === null, i = n ?? e.content, a = e.original === void 0 ? void 0 : G(e, e.original) ?? e.original, o = E.formatSwitch && !r && (t === "yaml" || t === "json"), s = t === "json" ? "yaml" : "json", c = o ? K(i, t, s) : null, l = o && qe.value !== t && c !== null;
|
|
138
|
+
return {
|
|
139
|
+
file: e,
|
|
140
|
+
native: t,
|
|
141
|
+
switchable: o,
|
|
142
|
+
convertible: c !== null,
|
|
143
|
+
language: l ? s : t,
|
|
144
|
+
text: l ? c : i,
|
|
145
|
+
original: l && a !== void 0 ? K(a, t, s) ?? void 0 : a,
|
|
146
|
+
undecodable: r,
|
|
147
|
+
readonly: E.readonly || !!e.readonly || r
|
|
148
|
+
};
|
|
149
|
+
}), H = c(() => {
|
|
150
|
+
let e = V.value;
|
|
151
|
+
if (!e) return "";
|
|
152
|
+
let t = F.value;
|
|
153
|
+
return t && t.name === e.file.name && t.language === e.language && t.basis === e.file.content ? t.text : e.text;
|
|
154
|
+
}), U = c(() => !!R.value?.secret && !P.value), it = c(() => !!F.value?.broken && H.value === F.value.text), at = c(() => {
|
|
155
|
+
let e = V.value;
|
|
156
|
+
return ["yaml", "json"].map((t) => ({
|
|
157
|
+
value: t,
|
|
158
|
+
label: t.toUpperCase(),
|
|
159
|
+
disabled: !!e && t !== e.language && (it.value || t !== e.native && !e.convertible)
|
|
160
|
+
}));
|
|
161
|
+
}), ot = c(() => {
|
|
162
|
+
if (!L.value) return null;
|
|
163
|
+
let e = V.value, t = I.value;
|
|
164
|
+
return e && e.language !== e.native && t?.name === e.file.name ? {
|
|
165
|
+
...L.value,
|
|
166
|
+
[e.file.name]: t.problems
|
|
167
|
+
} : L.value;
|
|
168
|
+
}), st = c(() => D.value.filter(q).length), ct = c(() => D.value.filter((e) => J(e).length).length), lt = c(() => D.value.map((e) => ({
|
|
169
|
+
value: e.name,
|
|
170
|
+
label: e.name,
|
|
171
|
+
description: [Y(e), X(e)].filter(Boolean).join(" · ") || void 0
|
|
172
|
+
})));
|
|
173
|
+
function W(e) {
|
|
174
|
+
if (e.language) return e.language;
|
|
175
|
+
let t = e.name.includes(".") ? e.name.split(".").pop().toLowerCase() : "";
|
|
176
|
+
return Qe[t] ?? "text";
|
|
177
|
+
}
|
|
178
|
+
function G(e, t) {
|
|
179
|
+
if (e.encoding !== "base64") return t;
|
|
180
|
+
try {
|
|
181
|
+
let e = Uint8Array.from(atob(t.replace(/\s/g, "")), (e) => e.charCodeAt(0));
|
|
182
|
+
return new TextDecoder("utf-8", { fatal: !0 }).decode(e);
|
|
183
|
+
} catch {
|
|
184
|
+
return null;
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
function ut(e, t) {
|
|
188
|
+
if (e.encoding !== "base64") return t;
|
|
189
|
+
let n = "";
|
|
190
|
+
for (let e of new TextEncoder().encode(t)) n += String.fromCharCode(e);
|
|
191
|
+
return btoa(n);
|
|
192
|
+
}
|
|
193
|
+
function K(e, t, n) {
|
|
194
|
+
let r = N.value;
|
|
195
|
+
if (!r) return null;
|
|
196
|
+
if (!e.trim()) return "";
|
|
197
|
+
try {
|
|
198
|
+
let i = t === "json" ? JSON.parse(e) : r.parse(e);
|
|
199
|
+
return n === "json" ? JSON.stringify(i, null, 2) + "\n" : r.stringify(i, { lineWidth: 0 });
|
|
200
|
+
} catch {
|
|
201
|
+
return null;
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
function q(e) {
|
|
205
|
+
return e.original !== void 0 && e.content !== e.original;
|
|
206
|
+
}
|
|
207
|
+
function J(e) {
|
|
208
|
+
return ot.value?.[e.name] ?? [];
|
|
209
|
+
}
|
|
210
|
+
function dt(e) {
|
|
211
|
+
return J(e).some((e) => e.severity === "error");
|
|
212
|
+
}
|
|
213
|
+
function Y(e) {
|
|
214
|
+
return [e.kind, e.description].filter(Boolean).join(" · ");
|
|
215
|
+
}
|
|
216
|
+
function X(e) {
|
|
217
|
+
let t = J(e).length;
|
|
218
|
+
return [q(e) && "Changed", t && `${t} ${t === 1 ? "problem" : "problems"}`].filter(Boolean).join(", ");
|
|
219
|
+
}
|
|
220
|
+
function ft(e) {
|
|
221
|
+
return e.secret ? pe : Ze[W(e)];
|
|
222
|
+
}
|
|
223
|
+
function pt(e, t) {
|
|
224
|
+
D.value = D.value.map((n) => n.name === e ? {
|
|
225
|
+
...n,
|
|
226
|
+
content: t
|
|
227
|
+
} : n);
|
|
228
|
+
}
|
|
229
|
+
function mt(e) {
|
|
230
|
+
let t = V.value;
|
|
231
|
+
if (!t || e === H.value) return;
|
|
232
|
+
if (t.language === t.native) return pt(t.file.name, ut(t.file, e));
|
|
233
|
+
let n = K(e, t.language, t.native), r = n === null ? t.file.content : ut(t.file, n);
|
|
234
|
+
F.value = {
|
|
235
|
+
name: t.file.name,
|
|
236
|
+
language: t.language,
|
|
237
|
+
text: e,
|
|
238
|
+
basis: r,
|
|
239
|
+
broken: n === null
|
|
240
|
+
}, r !== t.file.content && pt(t.file.name, r);
|
|
241
|
+
}
|
|
242
|
+
function ht(e) {
|
|
243
|
+
V.value && (I.value = {
|
|
244
|
+
name: V.value.file.name,
|
|
245
|
+
problems: e
|
|
246
|
+
});
|
|
247
|
+
}
|
|
248
|
+
function gt(e) {
|
|
249
|
+
e && (F.value = null, qe.value = e);
|
|
250
|
+
}
|
|
251
|
+
function _t(e, t) {
|
|
252
|
+
t instanceof HTMLElement ? M.set(e, t) : M.delete(e);
|
|
253
|
+
}
|
|
254
|
+
function Z(e, t = !1) {
|
|
255
|
+
O.value = e, t && M.get(e)?.focus();
|
|
256
|
+
}
|
|
257
|
+
let Q = "", $;
|
|
258
|
+
function vt(e, t) {
|
|
259
|
+
clearTimeout($), Q += e.toLowerCase(), $ = setTimeout(() => Q = "", 500);
|
|
260
|
+
let n = z.value;
|
|
261
|
+
for (let e = 1; e <= n.length; e++) {
|
|
262
|
+
let r = n[(t + (Q.length === 1 ? e : e - 1)) % n.length];
|
|
263
|
+
if (r.name.toLowerCase().startsWith(Q)) return Z(r.name, !0);
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
function yt(e, t) {
|
|
267
|
+
let n = z.value, r = {
|
|
268
|
+
ArrowDown: t + 1,
|
|
269
|
+
ArrowUp: t - 1,
|
|
270
|
+
Home: 0,
|
|
271
|
+
End: n.length - 1
|
|
272
|
+
};
|
|
273
|
+
if (e.key in r) {
|
|
274
|
+
if (e.preventDefault(), e.key === "ArrowUp" && t === 0 && rt.value) return nt.value?.querySelector("input")?.focus();
|
|
275
|
+
let i = n[Math.min(Math.max(r[e.key], 0), n.length - 1)];
|
|
276
|
+
i && Z(i.name, !0);
|
|
277
|
+
} else e.key === "Enter" || e.key === " " ? (e.preventDefault(), Z(n[t].name), e.key === "Enter" && _(At)) : e.key.length === 1 && e.key !== " " && !e.ctrlKey && !e.metaKey && !e.altKey && vt(e.key, t);
|
|
278
|
+
}
|
|
279
|
+
function bt(e) {
|
|
280
|
+
e.key === "ArrowDown" && B.value && (e.preventDefault(), Z(B.value, !0));
|
|
281
|
+
}
|
|
282
|
+
let xt = {
|
|
283
|
+
yaml: "yaml",
|
|
284
|
+
json: "json",
|
|
285
|
+
shell: "sh"
|
|
286
|
+
};
|
|
287
|
+
function St(e, t) {
|
|
288
|
+
return /\.[A-Za-z0-9]+$/.test(e) ? e : `${e}.${xt[t] ?? "txt"}`;
|
|
289
|
+
}
|
|
290
|
+
function Ct() {
|
|
291
|
+
let e = V.value;
|
|
292
|
+
if (!e) return;
|
|
293
|
+
let t = URL.createObjectURL(new Blob([H.value], { type: "text/plain;charset=utf-8" })), n = document.createElement("a");
|
|
294
|
+
n.href = t, n.download = St(e.file.name, e.language), n.click(), URL.revokeObjectURL(t), Ye("download", e.file);
|
|
295
|
+
}
|
|
296
|
+
function wt(e) {
|
|
297
|
+
P.value = e, _(() => e ? A.value?.focus() : (j.value?.$el)?.focus());
|
|
298
|
+
}
|
|
299
|
+
let Tt, Et = 0, Dt = /* @__PURE__ */ new Map();
|
|
300
|
+
async function Ot() {
|
|
301
|
+
let e = ++Et, t = {}, n = E.validate && D.value.some((e) => ["yaml", "json"].includes(W(e))) ? await et() : void 0;
|
|
302
|
+
for (let r of D.value) {
|
|
303
|
+
let i = W(r), a = G(r, r.content);
|
|
304
|
+
if (!n || a === null || i !== "yaml" && i !== "json") {
|
|
305
|
+
t[r.name] = [];
|
|
306
|
+
continue;
|
|
307
|
+
}
|
|
308
|
+
let o = Dt.get(r.name);
|
|
309
|
+
if (o && o.text === a && o.language === i && o.schema === r.schema) {
|
|
310
|
+
t[r.name] = o.problems;
|
|
311
|
+
continue;
|
|
312
|
+
}
|
|
313
|
+
let s = await n.checkDocument(a, i, r.schema);
|
|
314
|
+
if (e !== Et) return;
|
|
315
|
+
let c = n.toProblems(s, ve.of(a.split("\n")));
|
|
316
|
+
Dt.set(r.name, {
|
|
317
|
+
text: a,
|
|
318
|
+
language: i,
|
|
319
|
+
schema: r.schema,
|
|
320
|
+
problems: c
|
|
321
|
+
}), t[r.name] = c;
|
|
322
|
+
}
|
|
323
|
+
e === Et && (L.value = t);
|
|
324
|
+
}
|
|
325
|
+
function kt() {
|
|
326
|
+
clearTimeout(Tt), Tt = setTimeout(Ot, L.value ? 300 : 0);
|
|
327
|
+
}
|
|
328
|
+
function At() {
|
|
329
|
+
U.value ? (j.value?.$el)?.focus() : A.value?.focus();
|
|
330
|
+
}
|
|
331
|
+
w([() => D.value.map((e) => e.name).join("\n"), O], () => {
|
|
332
|
+
D.value.length && !R.value && (O.value = D.value[0].name);
|
|
333
|
+
}, { immediate: !0 }), w(O, (e) => {
|
|
334
|
+
P.value = !1, F.value = null, I.value = null, _(() => M.get(e)?.scrollIntoView({ block: "nearest" }));
|
|
335
|
+
}), w(() => E.formatSwitch, async (e) => {
|
|
336
|
+
e && !N.value && (N.value = await import("yaml"));
|
|
337
|
+
}, { immediate: !0 }), w([D, () => E.validate], kt, {
|
|
338
|
+
deep: !0,
|
|
339
|
+
immediate: !0
|
|
340
|
+
});
|
|
341
|
+
let jt = "";
|
|
342
|
+
return w(ot, (e) => {
|
|
343
|
+
if (!e) return;
|
|
344
|
+
let t = JSON.stringify(e);
|
|
345
|
+
t !== jt && (jt = t, Ye("validate", e));
|
|
346
|
+
}), te(() => {
|
|
347
|
+
clearTimeout(Tt), clearTimeout($);
|
|
348
|
+
}), g({ focus: At }), (c, g) => (y(), d("div", {
|
|
349
|
+
class: "@container min-w-0 overflow-hidden rounded-10 border border-border bg-surface shadow-xs",
|
|
350
|
+
style: ee({ height: h.height }),
|
|
351
|
+
"aria-busy": h.loading || void 0,
|
|
352
|
+
"data-ac-ds": "",
|
|
353
|
+
"data-testid": "ac-file-editor"
|
|
354
|
+
}, [h.loading ? (y(), d("div", be, [
|
|
355
|
+
f("div", xe, [(y(), d(s, null, ne(Xe, (e, n) => f("div", {
|
|
356
|
+
key: n,
|
|
357
|
+
class: "flex h-11 items-center gap-2.5 px-2.5"
|
|
358
|
+
}, [m(t, {
|
|
359
|
+
shape: "rect",
|
|
360
|
+
width: "16px",
|
|
361
|
+
height: "16px",
|
|
362
|
+
label: ""
|
|
363
|
+
}), f("div", Se, [m(t, {
|
|
364
|
+
width: e,
|
|
365
|
+
height: "10px",
|
|
366
|
+
label: ""
|
|
367
|
+
}, null, 8, ["width"]), m(t, {
|
|
368
|
+
width: "35%",
|
|
369
|
+
height: "8px",
|
|
370
|
+
label: ""
|
|
371
|
+
})])])), 64))]),
|
|
372
|
+
f("div", Ce, [m(t, {
|
|
373
|
+
shape: "rect",
|
|
374
|
+
height: "36px",
|
|
375
|
+
label: ""
|
|
376
|
+
})]),
|
|
377
|
+
m(t, {
|
|
378
|
+
shape: "editor",
|
|
379
|
+
height: "100%",
|
|
380
|
+
label: "Loading files",
|
|
381
|
+
class: "min-h-0 min-w-0 flex-1 [&>div]:rounded-none [&>div]:border-0 [&>div]:shadow-none"
|
|
382
|
+
})
|
|
383
|
+
])) : D.value.length ? (y(), d("div", Te, [
|
|
384
|
+
f("div", Ee, [
|
|
385
|
+
rt.value ? (y(), d("div", {
|
|
386
|
+
key: 0,
|
|
387
|
+
ref_key: "searchWrap",
|
|
388
|
+
ref: nt,
|
|
389
|
+
class: "border-b border-border-light p-2",
|
|
390
|
+
onKeydown: bt
|
|
391
|
+
}, [m(n, {
|
|
392
|
+
modelValue: k.value,
|
|
393
|
+
"onUpdate:modelValue": g[0] ||= (e) => k.value = e,
|
|
394
|
+
placeholder: "Search files",
|
|
395
|
+
debounce: 0
|
|
396
|
+
}, null, 8, ["modelValue"])], 544)) : u("", !0),
|
|
397
|
+
z.value.length ? (y(), d("ul", {
|
|
398
|
+
key: 1,
|
|
399
|
+
role: "listbox",
|
|
400
|
+
"aria-label": h.label,
|
|
401
|
+
"aria-controls": tt,
|
|
402
|
+
class: "ac-scrollbar flex min-h-0 flex-1 flex-col gap-0.5 overflow-y-auto p-1.5"
|
|
403
|
+
}, [(y(!0), d(s, null, ne(z.value, (e, t) => (y(), d("li", {
|
|
404
|
+
key: e.name,
|
|
405
|
+
ref_for: !0,
|
|
406
|
+
ref: (t) => _t(e.name, t),
|
|
407
|
+
role: "option",
|
|
408
|
+
"aria-selected": e.name === O.value,
|
|
409
|
+
tabindex: e.name === B.value ? 0 : -1,
|
|
410
|
+
title: e.name,
|
|
411
|
+
class: v(["flex min-h-9 shrink-0 cursor-pointer items-center gap-2.5 rounded-6 px-2.5 py-1.5 transition-[background-color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:ring-ring", e.name === O.value ? "bg-surface text-heading shadow-xs ring-1 ring-border" : "text-body hover:bg-surface-sunken"]),
|
|
412
|
+
onClick: (t) => Z(e.name, !0),
|
|
413
|
+
onKeydown: (e) => yt(e, t)
|
|
414
|
+
}, [
|
|
415
|
+
(y(), l(ie(ft(e)), {
|
|
416
|
+
class: v(["size-4 shrink-0", e.name === O.value ? "text-primary" : "text-muted"]),
|
|
417
|
+
"aria-hidden": "true"
|
|
418
|
+
}, null, 8, ["class"])),
|
|
419
|
+
f("span", ke, [f("span", Ae, x(e.name), 1), Y(e) ? (y(), d("span", je, x(Y(e)), 1)) : u("", !0)]),
|
|
420
|
+
J(e).length ? (y(), d("span", {
|
|
421
|
+
key: 0,
|
|
422
|
+
class: v(["inline-flex shrink-0 items-center gap-1 text-xs font-medium tabular-nums", dt(e) ? "text-red-40" : "text-yellow-30"])
|
|
423
|
+
}, [(y(), l(ie(dt(e) ? S(se) : S(_e)), {
|
|
424
|
+
class: "size-3.5",
|
|
425
|
+
"aria-hidden": "true"
|
|
426
|
+
})), p(" " + x(J(e).length), 1)], 2)) : u("", !0),
|
|
427
|
+
q(e) ? (y(), d("span", Me)) : u("", !0),
|
|
428
|
+
X(e) ? (y(), d("span", Ne, ", " + x(X(e)), 1)) : u("", !0)
|
|
429
|
+
], 42, Oe))), 128))], 8, De)) : (y(), d("div", Pe, [m(r, {
|
|
430
|
+
variant: "search",
|
|
431
|
+
size: "small",
|
|
432
|
+
query: k.value.trim(),
|
|
433
|
+
description: "Try a file name, kind or a word in the file."
|
|
434
|
+
}, null, 8, ["query"])])),
|
|
435
|
+
f("p", Fe, [
|
|
436
|
+
p(x(D.value.length) + " " + x(D.value.length === 1 ? "file" : "files"), 1),
|
|
437
|
+
st.value ? (y(), d(s, { key: 0 }, [p(" · " + x(st.value) + " changed", 1)], 64)) : u("", !0),
|
|
438
|
+
ct.value ? (y(), d(s, { key: 1 }, [g[5] ||= p(" · ", -1), f("span", Ie, x(ct.value) + " with problems", 1)], 64)) : u("", !0)
|
|
439
|
+
])
|
|
440
|
+
]),
|
|
441
|
+
f("div", Le, [m(i, {
|
|
442
|
+
"model-value": O.value,
|
|
443
|
+
options: lt.value,
|
|
444
|
+
searchable: D.value.length > 8,
|
|
445
|
+
placeholder: h.label,
|
|
446
|
+
size: "compact",
|
|
447
|
+
"onUpdate:modelValue": g[1] ||= (e) => typeof e == "string" && Z(e)
|
|
448
|
+
}, null, 8, [
|
|
449
|
+
"model-value",
|
|
450
|
+
"options",
|
|
451
|
+
"searchable",
|
|
452
|
+
"placeholder"
|
|
453
|
+
])]),
|
|
454
|
+
V.value ? (y(), d("section", {
|
|
455
|
+
key: 0,
|
|
456
|
+
id: tt,
|
|
457
|
+
"aria-label": V.value.file.name,
|
|
458
|
+
class: "flex min-h-0 min-w-0 flex-1 flex-col"
|
|
459
|
+
}, [V.value.undecodable ? (y(), d("p", ze, " This value isn't base64-encoded text, so it's shown as stored and can't be edited here. ")) : u("", !0), U.value ? (y(), d(s, { key: 1 }, [f("div", Be, [
|
|
460
|
+
f("span", Ve, x(V.value.file.name), 1),
|
|
461
|
+
f("span", He, [m(S(ge), {
|
|
462
|
+
class: "size-3",
|
|
463
|
+
"aria-hidden": "true"
|
|
464
|
+
}), g[6] ||= p("Secret ", -1)]),
|
|
465
|
+
f("div", Ue, [re(c.$slots, "actions", { file: V.value.file })])
|
|
466
|
+
]), f("div", We, [m(r, {
|
|
467
|
+
icon: S(ge),
|
|
468
|
+
title: "Value hidden",
|
|
469
|
+
description: "Secret values stay hidden until you show them.",
|
|
470
|
+
size: "small"
|
|
471
|
+
}, {
|
|
472
|
+
actions: T(() => [m(e, {
|
|
473
|
+
ref_key: "revealButton",
|
|
474
|
+
ref: j,
|
|
475
|
+
title: "Show value",
|
|
476
|
+
color: "white",
|
|
477
|
+
size: "small",
|
|
478
|
+
onClick: g[2] ||= (e) => wt(!0)
|
|
479
|
+
}, {
|
|
480
|
+
icon: T(() => [m(S(le))]),
|
|
481
|
+
_: 1
|
|
482
|
+
}, 512)]),
|
|
483
|
+
_: 1
|
|
484
|
+
}, 8, ["icon"])])], 64)) : (y(), l(o, {
|
|
485
|
+
ref_key: "editorRef",
|
|
486
|
+
ref: A,
|
|
487
|
+
key: `${V.value.file.name}:${V.value.language}`,
|
|
488
|
+
view: Je.value,
|
|
489
|
+
"onUpdate:view": g[4] ||= (e) => Je.value = e,
|
|
490
|
+
"model-value": H.value,
|
|
491
|
+
language: V.value.language,
|
|
492
|
+
original: V.value.original,
|
|
493
|
+
schema: V.value.file.schema,
|
|
494
|
+
readonly: V.value.readonly,
|
|
495
|
+
validate: h.validate,
|
|
496
|
+
wrap: h.wrap,
|
|
497
|
+
copyable: h.copyable,
|
|
498
|
+
title: V.value.file.name,
|
|
499
|
+
bordered: !1,
|
|
500
|
+
height: "100%",
|
|
501
|
+
class: "h-full min-h-0 flex-1",
|
|
502
|
+
"onUpdate:modelValue": mt,
|
|
503
|
+
onValidate: ht
|
|
504
|
+
}, {
|
|
505
|
+
actions: T(() => [
|
|
506
|
+
re(c.$slots, "actions", { file: V.value.file }),
|
|
507
|
+
V.value.switchable ? (y(), l(a, {
|
|
508
|
+
key: 0,
|
|
509
|
+
"model-value": V.value.language,
|
|
510
|
+
options: at.value,
|
|
511
|
+
size: "small",
|
|
512
|
+
label: "Format",
|
|
513
|
+
"onUpdate:modelValue": gt
|
|
514
|
+
}, null, 8, ["model-value", "options"])) : u("", !0),
|
|
515
|
+
h.downloadable && !U.value ? (y(), d("button", {
|
|
516
|
+
key: 1,
|
|
517
|
+
type: "button",
|
|
518
|
+
class: "inline-flex size-7 shrink-0 cursor-pointer items-center justify-center rounded-6 text-muted transition hover:bg-surface-sunken hover:text-heading focus-visible:outline-none focus-visible:ring-[3px] focus-visible:ring-ring",
|
|
519
|
+
"aria-label": `Download ${V.value.file.name}`,
|
|
520
|
+
title: "Download",
|
|
521
|
+
"data-testid": "ac-file-editor-download",
|
|
522
|
+
onClick: Ct
|
|
523
|
+
}, [m(S(ce), {
|
|
524
|
+
class: "size-3.5",
|
|
525
|
+
"aria-hidden": "true"
|
|
526
|
+
})], 8, Ge)) : u("", !0),
|
|
527
|
+
V.value.file.secret ? (y(), d("button", {
|
|
528
|
+
key: 2,
|
|
529
|
+
type: "button",
|
|
530
|
+
class: "inline-flex size-7 shrink-0 cursor-pointer items-center justify-center rounded-6 text-muted transition hover:bg-surface-sunken hover:text-heading focus-visible:outline-none focus-visible:ring-[3px] focus-visible:ring-ring",
|
|
531
|
+
"aria-label": "Hide value",
|
|
532
|
+
title: "Hide value",
|
|
533
|
+
onClick: g[3] ||= (e) => wt(!1)
|
|
534
|
+
}, [m(S(ue), {
|
|
535
|
+
class: "size-3.5",
|
|
536
|
+
"aria-hidden": "true"
|
|
537
|
+
})])) : u("", !0)
|
|
538
|
+
]),
|
|
539
|
+
_: 3
|
|
540
|
+
}, 8, [
|
|
541
|
+
"view",
|
|
542
|
+
"model-value",
|
|
543
|
+
"language",
|
|
544
|
+
"original",
|
|
545
|
+
"schema",
|
|
546
|
+
"readonly",
|
|
547
|
+
"validate",
|
|
548
|
+
"wrap",
|
|
549
|
+
"copyable",
|
|
550
|
+
"title"
|
|
551
|
+
]))], 8, Re)) : u("", !0)
|
|
552
|
+
])) : (y(), d("div", we, [re(c.$slots, "empty", {}, () => [m(r, { title: h.emptyText }, null, 8, ["title"])])]))], 12, ye));
|
|
553
|
+
}
|
|
554
|
+
});
|
|
555
|
+
//#endregion
|
|
556
|
+
export { Ke as default };
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
export interface FileRejection {
|
|
2
|
+
/** The file that was turned away. */
|
|
3
|
+
file: File;
|
|
4
|
+
/** `type` when it doesn't match `accept`, `size` when it's bigger than `maxSize`. */
|
|
5
|
+
reason: "type" | "size";
|
|
6
|
+
/** A sentence you can show as is. */
|
|
7
|
+
message: string;
|
|
8
|
+
}
|
|
9
|
+
export interface Props {
|
|
10
|
+
/** Label above the field, e.g. "Kubeconfig". Also names the picker button for screen readers. */
|
|
11
|
+
label?: string;
|
|
12
|
+
/** File types to allow, as for the native input: `.yaml,.yml`, `image/*`, `application/json`. */
|
|
13
|
+
accept?: string;
|
|
14
|
+
/** Allow several files. Without it, a new file replaces the current one. */
|
|
15
|
+
multiple?: boolean;
|
|
16
|
+
/** Largest allowed file in bytes, e.g. `1024 * 1024` for 1 MB. `0` means no limit. */
|
|
17
|
+
maxSize?: number;
|
|
18
|
+
/** Single-line field with a "Choose file" button instead of the drop zone. For tight forms. */
|
|
19
|
+
small?: boolean;
|
|
20
|
+
/** Line under the prompt. Defaults to the allowed types and size, e.g. ".yaml, .yml · up to 1 MB". */
|
|
21
|
+
description?: string;
|
|
22
|
+
/** Native `name` attribute of the file input. */
|
|
23
|
+
name?: string;
|
|
24
|
+
/** Marks the field required and adds a red asterisk to the label. */
|
|
25
|
+
required?: boolean;
|
|
26
|
+
/** Disables picking, dropping and removing. */
|
|
27
|
+
disabled?: boolean;
|
|
28
|
+
/** Error text under the field, e.g. from server-side validation. Type and size errors are shown automatically. */
|
|
29
|
+
errorMsg?: string;
|
|
30
|
+
/** Helper text under the field (hidden while there's an error). */
|
|
31
|
+
hint?: string;
|
|
32
|
+
}
|
|
33
|
+
type __VLS_Props = Props;
|
|
34
|
+
declare function openPicker(): void;
|
|
35
|
+
type __VLS_ModelProps = {
|
|
36
|
+
/** The chosen files. Always an array, even without `multiple`. */
|
|
37
|
+
modelValue?: File[];
|
|
38
|
+
};
|
|
39
|
+
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
40
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {
|
|
41
|
+
/** Opens the native file picker. */
|
|
42
|
+
open: typeof openPicker;
|
|
43
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
44
|
+
"update:modelValue": (value: File[]) => any;
|
|
45
|
+
add: (files: File[]) => any;
|
|
46
|
+
remove: (file: File) => any;
|
|
47
|
+
reject: (rejections: FileRejection[]) => any;
|
|
48
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
49
|
+
"onUpdate:modelValue"?: ((value: File[]) => any) | undefined;
|
|
50
|
+
onAdd?: ((files: File[]) => any) | undefined;
|
|
51
|
+
onRemove?: ((file: File) => any) | undefined;
|
|
52
|
+
onReject?: ((rejections: FileRejection[]) => any) | undefined;
|
|
53
|
+
}>, {
|
|
54
|
+
multiple: boolean;
|
|
55
|
+
required: boolean;
|
|
56
|
+
small: boolean;
|
|
57
|
+
label: string;
|
|
58
|
+
description: string;
|
|
59
|
+
disabled: boolean;
|
|
60
|
+
name: string;
|
|
61
|
+
hint: string;
|
|
62
|
+
errorMsg: string;
|
|
63
|
+
accept: string;
|
|
64
|
+
maxSize: number;
|
|
65
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
66
|
+
declare const _default: typeof __VLS_export;
|
|
67
|
+
export default _default;
|