@bagelink/vue 1.20.76 → 1.20.80
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/StructuredEditor-B-Vp4pa2.cjs +2 -0
- package/dist/StructuredEditor-DWfRtYZa.js +2431 -0
- package/dist/StructuredEditor.css +1 -0
- package/dist/babel-BVvTH0ev.js +10053 -0
- package/dist/babel-BzIDwrmk.cjs +16 -0
- package/dist/components/form/inputs/CodeEditor/Index.vue.d.ts +45 -28
- package/dist/components/form/inputs/CodeEditor/Index.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/CodeEditor/SearchPanel.vue.d.ts +10 -0
- package/dist/components/form/inputs/CodeEditor/SearchPanel.vue.d.ts.map +1 -0
- package/dist/components/form/inputs/CodeEditor/StructuredEditor.vue.d.ts +27 -0
- package/dist/components/form/inputs/CodeEditor/StructuredEditor.vue.d.ts.map +1 -0
- package/dist/components/form/inputs/CodeEditor/formatCode.d.ts +4 -0
- package/dist/components/form/inputs/CodeEditor/formatCode.d.ts.map +1 -0
- package/dist/components/form/inputs/DatePicker.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/OTP.vue.d.ts +2 -2
- package/dist/components/form/inputs/OTP.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/RichText/index.vue.d.ts.map +1 -1
- package/dist/core.css +3 -1
- package/dist/dist-B-MCiFKR.cjs +10 -0
- package/dist/dist-B0uc2InW.js +6 -0
- package/dist/dist-BIAEQGHn.cjs +1 -0
- package/dist/dist-BLxHnfU6.js +1071 -0
- package/dist/dist-BRA2DQF2.cjs +1 -0
- package/dist/dist-BnLdfA7w.js +69 -0
- package/dist/dist-CL50Ff42.cjs +1 -0
- package/dist/dist-CwUttjIh.js +1100 -0
- package/dist/dist-CzY35u4H.cjs +1 -0
- package/dist/dist-D8OWrPLr.js +1336 -0
- package/dist/dist-DSCI9g6w.cjs +13 -0
- package/dist/dist-DsBgijLf.cjs +1 -0
- package/dist/dist-GbVY_Jpv.cjs +1 -0
- package/dist/dist-IV7z-zur.js +11909 -0
- package/dist/dist-Mr0UMyoK.js +1063 -0
- package/dist/dist-jq7acmcZ.js +6 -0
- package/dist/estree-CKgw47OZ.js +8211 -0
- package/dist/estree-HqeJuE3g.cjs +44 -0
- package/dist/html-B-hsQYII.js +7289 -0
- package/dist/html-BrqW5pT-.cjs +25 -0
- package/dist/index.cjs +1 -764
- package/dist/index.mjs +308 -65621
- package/dist/postcss-Bk65KKdh.js +6703 -0
- package/dist/postcss-BxY0xtVZ.cjs +61 -0
- package/dist/src-DwJEyASG.js +65571 -0
- package/dist/src-Uy-ww1Nz.cjs +764 -0
- package/dist/src.css +1 -0
- package/dist/standalone-CAcRm_h6.cjs +29 -0
- package/dist/standalone-D-HcbQmf.js +3549 -0
- package/dist/style.css +3 -1
- package/dist/utils/calendarDate.d.ts +6 -0
- package/dist/utils/calendarDate.d.ts.map +1 -0
- package/dist/utils/date.d.ts.map +1 -1
- package/package.json +13 -2
- package/src/components/form/inputs/CodeEditor/Index.vue +70 -310
- package/src/components/form/inputs/CodeEditor/SearchPanel.vue +124 -0
- package/src/components/form/inputs/CodeEditor/StructuredEditor.vue +266 -0
- package/src/components/form/inputs/CodeEditor/formatCode.ts +34 -0
- package/src/components/form/inputs/DatePicker.vue +4 -1
- package/src/components/form/inputs/OTP.vue +42 -19
- package/src/components/form/inputs/RichText/index.vue +2 -1
- package/src/utils/calendarDate.ts +16 -0
- package/src/utils/date.ts +2 -1
- package/vite.config.ts +5 -3
- package/dist/components/form/inputs/CodeEditor/useHighlight.d.ts +0 -33
- package/dist/components/form/inputs/CodeEditor/useHighlight.d.ts.map +0 -1
- package/dist/index.css +0 -1
- package/src/components/form/inputs/CodeEditor/useHighlight.ts +0 -123
- /package/dist/{page-flip.browser-BXnk8BM6.js → page-flip.browser-0kqlwcC8.js} +0 -0
- /package/dist/{page-flip.browser-ByKQXhqK.cjs → page-flip.browser-Dfy5mAgM.cjs} +0 -0
- /package/dist/{pdf-CV7M2d0x.cjs → pdf-BBd7GH-5.cjs} +0 -0
- /package/dist/{pdf-DuN3_wNN.js → pdf-scP2ZqGZ.js} +0 -0
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Parse date-only ISO values as local calendar days, not midnight UTC.
|
|
3
|
+
* Datetimes retain JavaScript's existing timezone/offset handling.
|
|
4
|
+
*/
|
|
5
|
+
export declare function parseCalendarDate(value: string | number | Date): Date;
|
|
6
|
+
//# sourceMappingURL=calendarDate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"calendarDate.d.ts","sourceRoot":"","sources":["../../src/utils/calendarDate.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,GAAG,IAAI,CAWrE"}
|
package/dist/utils/date.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"date.d.ts","sourceRoot":"","sources":["../../src/utils/date.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"date.d.ts","sourceRoot":"","sources":["../../src/utils/date.ts"],"names":[],"mappings":"AAiBA,MAAM,MAAM,SAAS,GAAG,IAAI,GAAG,MAAM,GAAG,MAAM,CAAA;AA6B9C,iBAAS,SAAS,CAAC,KAAK,EAAE,SAAS,GAAG,IAAI,CAQzC;AAED,eAAO,MAAM,GAAG;IACf,oDAAoD;eACzC,SAAS,GAAG,MAAM;IAG7B,yDAAyD;gBAC7C,SAAS,GAAG,MAAM;IAG9B,gCAAgC;cACtB,SAAS,GAAG,MAAM;CAG3B,CAAA;AA2BF,eAAO,MAAM,KAAK;IACjB,6FAA6F;eACnF,IAAI,GAAgB,MAAM;IAGpC;;;;OAIG;gBACQ,IAAI,GAAgB,MAAM;IAMrC,iEAAiE;kBACpD,IAAI,GAAgB,MAAM;CAGvC,CAAA;AAED,MAAM,MAAM,aAAa,GAAG,MAA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AE,MAAM,EAAE,IAAI,CAAC,eAAe,EAAE,SAAS,CAAC,EAAE,IAAI,CAAC,qBAAqB;;;;;;;;;;;;;;EAkB/G;AAOD,wBAAgB,UAAU,CAAC,IAAI,CAAC,EAAE,SAAS,EAAE,MAAM,CAAC,EAAE,uBAAuB,GAAG,MAAM,CAAA;AACtF,wBAAgB,UAAU,CAAC,IAAI,CAAC,EAAE,SAAS,EAAE,IAAI,CAAC,EAAE,iBAAiB,GAAG,MAAM,CAAA;AAwF9E,eAAO,MAAM,OAAO,mBAAa,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bagelink/vue",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.20.
|
|
4
|
+
"version": "1.20.80",
|
|
5
5
|
"description": "Bagel core sdk packages",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "Bagel Studio",
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
"@types/signature_pad": "^4.0.0",
|
|
64
64
|
"vue": "^3.5.43",
|
|
65
65
|
"vue-component-type-helpers": "^2.2.12",
|
|
66
|
-
"@bagelink/sdk": "1.20.
|
|
66
|
+
"@bagelink/sdk": "1.20.80"
|
|
67
67
|
},
|
|
68
68
|
"peerDependencies": {
|
|
69
69
|
"@bagelink/sdk": "*",
|
|
@@ -82,8 +82,18 @@
|
|
|
82
82
|
"access": "public"
|
|
83
83
|
},
|
|
84
84
|
"dependencies": {
|
|
85
|
+
"@codemirror/commands": "^6.11.1",
|
|
86
|
+
"@codemirror/lang-css": "^6.3.1",
|
|
87
|
+
"@codemirror/lang-html": "^6.4.12",
|
|
88
|
+
"@codemirror/lang-javascript": "^6.2.5",
|
|
89
|
+
"@codemirror/lang-json": "^6.0.2",
|
|
90
|
+
"@codemirror/language": "^6.13.1",
|
|
91
|
+
"@codemirror/search": "^6.7.2",
|
|
92
|
+
"@codemirror/state": "^6.7.6",
|
|
93
|
+
"@codemirror/view": "^6.43.15",
|
|
85
94
|
"@floating-ui/dom": "^1.8.0",
|
|
86
95
|
"@oddbird/popover-polyfill": "^0.6.1",
|
|
96
|
+
"@uiw/codemirror-theme-atomone": "^4.25.12",
|
|
87
97
|
"@vueuse/core": "^13.9.0",
|
|
88
98
|
"@zxcvbn-ts/core": "^3.0.4",
|
|
89
99
|
"axios": "^1.20.0",
|
|
@@ -91,6 +101,7 @@
|
|
|
91
101
|
"libphonenumber-js": "^1.13.14",
|
|
92
102
|
"page-flip": "^2.0.7",
|
|
93
103
|
"pdfjs-dist": "^6.3.289",
|
|
104
|
+
"prettier": "^3.9.9",
|
|
94
105
|
"signature_pad": "^5.1.4",
|
|
95
106
|
"swiper": "^12.2.0",
|
|
96
107
|
"vue-i18n": "^11.4.12",
|
|
@@ -1,40 +1,38 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import type { PropType } from 'vue'
|
|
3
3
|
import type { Language, HighlightTheme } from './CodeTypes'
|
|
4
|
+
import { defineAsyncComponent, ref, computed, watch } from 'vue'
|
|
4
5
|
import { useDevice } from '../../../../index'
|
|
5
|
-
import { onMounted, ref, computed, watch } from 'vue'
|
|
6
6
|
import { useBagelInputShell } from '../bagelInputShell'
|
|
7
|
-
import { useHighlight } from './useHighlight'
|
|
8
7
|
|
|
9
|
-
|
|
8
|
+
const StructuredEditor = defineAsyncComponent(() => import('./StructuredEditor.vue'))
|
|
10
9
|
const props = defineProps({
|
|
11
10
|
language: { type: String as PropType<Language>, default: 'html' },
|
|
12
11
|
readonly: { type: Boolean, default: false },
|
|
13
12
|
modelValue: { type: [String, Object] as PropType<string | Record<string, any>>, default: '' },
|
|
13
|
+
/** @deprecated Set language explicitly. Retained as a no-op for compatibility. */
|
|
14
14
|
autodetect: { type: Boolean, default: true },
|
|
15
|
+
/** @deprecated CodeMirror tolerates incomplete syntax. Retained as a no-op. */
|
|
15
16
|
ignoreIllegals: { type: Boolean, default: true },
|
|
16
17
|
label: { type: String, default: '' },
|
|
17
18
|
placeholder: { type: String, default: '' },
|
|
18
19
|
height: { type: String, default: '240px' },
|
|
19
|
-
/** Mobile-only height override.
|
|
20
|
+
/** Mobile-only height override. CSS length or a unitless pixel value. */
|
|
20
21
|
mobileHeight: { type: String, default: undefined },
|
|
21
|
-
/**
|
|
22
|
-
* Cap the editor height (CSS length). Pair with `height="auto"` to let the
|
|
23
|
-
* editor grow with its content up to this cap — suits log/console output.
|
|
24
|
-
*/
|
|
22
|
+
/** Pair with height="auto" for content-sized, capped output. */
|
|
25
23
|
maxHeight: { type: String, default: undefined },
|
|
26
|
-
/**
|
|
27
|
-
* Terminal window chrome: a title bar with traffic-light dots on the
|
|
28
|
-
* project's code surface (`--bgl-code-bg` / `--bgl-code-color`).
|
|
29
|
-
*/
|
|
30
24
|
terminal: { type: Boolean, default: false },
|
|
31
|
-
/** Title shown in the terminal title bar (e.g. a file name or step key). */
|
|
32
25
|
title: { type: String, default: '' },
|
|
33
26
|
disabled: { type: Boolean, default: false },
|
|
34
|
-
/** Wrap long lines instead of scrolling horizontally */
|
|
35
27
|
wrap: { type: Boolean, default: false },
|
|
36
|
-
/**
|
|
28
|
+
/** Show the line-number gutter. */
|
|
29
|
+
lineNumbers: { type: Boolean, default: false },
|
|
30
|
+
/** Enable structural folding for supported languages. */
|
|
31
|
+
folding: { type: Boolean, default: false },
|
|
32
|
+
/** Show an explicit Format action; downloads the formatter only when clicked. */
|
|
33
|
+
formatting: { type: Boolean, default: false },
|
|
37
34
|
singleLine: { type: Boolean, default: false },
|
|
35
|
+
/** Legacy highlight.js theme names now map to light/dark appearance. */
|
|
38
36
|
theme: { type: String as PropType<HighlightTheme>, default: 'dark' },
|
|
39
37
|
frame: { type: Boolean, default: undefined },
|
|
40
38
|
outline: { type: Boolean, default: undefined },
|
|
@@ -43,156 +41,67 @@ const props = defineProps({
|
|
|
43
41
|
labelColor: { type: String, default: undefined },
|
|
44
42
|
labelActiveColor: { type: String, default: undefined },
|
|
45
43
|
})
|
|
46
|
-
|
|
47
44
|
const emit = defineEmits(['update:modelValue'])
|
|
48
|
-
|
|
49
45
|
const { shellClass, shellStyle } = useBagelInputShell(props)
|
|
46
|
+
const { isMobile } = useDevice()
|
|
50
47
|
|
|
51
|
-
// Track whether the original modelValue was an object
|
|
52
|
-
const isObjectMode = computed(() => typeof props.modelValue === 'object')
|
|
53
|
-
|
|
54
|
-
// Helper to convert value to string for display
|
|
55
48
|
function valueToString(value: string | Record<string, any>): string {
|
|
56
|
-
|
|
57
|
-
if (typeof value === 'object') {
|
|
58
|
-
return JSON.stringify(value, null, 2)
|
|
59
|
-
}
|
|
60
|
-
return ''
|
|
49
|
+
return typeof value === 'string' ? value : JSON.stringify(value, null, 2)
|
|
61
50
|
}
|
|
62
|
-
|
|
63
|
-
// State
|
|
64
51
|
const code = ref(valueToString(props.modelValue))
|
|
65
|
-
const hasCodeValue = computed(() => Boolean(code.value?.trim()))
|
|
66
|
-
const editorRef = ref<HTMLDivElement>()
|
|
67
52
|
const isFocused = ref(false)
|
|
68
|
-
const
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
const
|
|
53
|
+
const hasCodeValue = computed(() => Boolean(code.value?.trim()))
|
|
54
|
+
// Preserve object mode through temporarily invalid JSON while editing.
|
|
55
|
+
const objectMode = ref(typeof props.modelValue === 'object')
|
|
56
|
+
const editorHeight = computed(() => {
|
|
72
57
|
if (props.singleLine) return undefined
|
|
73
|
-
const
|
|
74
|
-
|
|
75
|
-
: props.height
|
|
76
|
-
return h.match(/^\d+$/) ? `${h}px` : h
|
|
58
|
+
const height = isMobile.value && props.mobileHeight !== undefined ? props.mobileHeight : props.height
|
|
59
|
+
return /^\d+$/.test(height) ? `${height}px` : height
|
|
77
60
|
})
|
|
78
|
-
|
|
79
|
-
/** Light hljs themes need a dark caret + light color-scheme for native scrollbars. */
|
|
80
61
|
const isLightTheme = computed(() => {
|
|
81
|
-
const
|
|
82
|
-
if (
|
|
83
|
-
|
|
84
|
-
if (t.includes('dark')) return false
|
|
85
|
-
if (t.includes('light') || t.includes('dawn')) return true
|
|
86
|
-
return [
|
|
62
|
+
const theme = String(props.theme).toLowerCase()
|
|
63
|
+
if (theme.includes('dark')) return false
|
|
64
|
+
return theme.includes('light') || theme.includes('dawn') || [
|
|
87
65
|
'github', 'xcode', 'vs', 'docco', 'default', 'foundation', 'googlecode',
|
|
88
66
|
'idea', 'magula', 'ascetic', 'brown-paper', 'color-brewer', 'grayscale',
|
|
89
67
|
'school-book', 'routeros', 'purebasic',
|
|
90
|
-
].includes(
|
|
68
|
+
].includes(theme)
|
|
91
69
|
})
|
|
92
70
|
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
props.language,
|
|
97
|
-
props.autodetect,
|
|
98
|
-
props.ignoreIllegals
|
|
99
|
-
)
|
|
100
|
-
})
|
|
101
|
-
|
|
102
|
-
function handleInput(e: Event) {
|
|
103
|
-
const target = e.target as HTMLTextAreaElement
|
|
104
|
-
code.value = target.value
|
|
105
|
-
|
|
106
|
-
// If originally an object, try to parse and emit object
|
|
107
|
-
if (isObjectMode.value) {
|
|
108
|
-
try {
|
|
109
|
-
const parsed = JSON.parse(code.value)
|
|
110
|
-
emit('update:modelValue', parsed)
|
|
111
|
-
} catch {
|
|
112
|
-
// If parsing fails, emit the string as-is (user is still typing)
|
|
113
|
-
// This allows intermediate invalid JSON states while editing
|
|
114
|
-
emit('update:modelValue', code.value)
|
|
115
|
-
}
|
|
116
|
-
} else {
|
|
117
|
-
emit('update:modelValue', code.value)
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
function handleKeydown(event: KeyboardEvent) {
|
|
122
|
-
if (props.singleLine) {
|
|
123
|
-
if (event.key === 'Enter') event.preventDefault()
|
|
124
|
-
return
|
|
125
|
-
}
|
|
126
|
-
handleTab(event)
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
function handleTab(event: KeyboardEvent) {
|
|
130
|
-
if (event.key !== 'Tab') { return }
|
|
131
|
-
|
|
132
|
-
event.preventDefault()
|
|
133
|
-
const target = event.target as HTMLTextAreaElement
|
|
134
|
-
const start = target.selectionStart
|
|
135
|
-
const end = target.selectionEnd
|
|
136
|
-
|
|
137
|
-
// Add tab or indent selected text
|
|
138
|
-
const newValue = `${code.value.substring(0, start)} ${code.value.substring(end)}`
|
|
139
|
-
code.value = newValue
|
|
140
|
-
|
|
141
|
-
// If originally an object, try to parse and emit object
|
|
142
|
-
if (isObjectMode.value) {
|
|
71
|
+
function updateCode(value: string) {
|
|
72
|
+
code.value = value
|
|
73
|
+
if (objectMode.value) {
|
|
143
74
|
try {
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
} catch {
|
|
147
|
-
// If parsing fails, emit the string as-is
|
|
148
|
-
emit('update:modelValue', code.value)
|
|
75
|
+
emit('update:modelValue', JSON.parse(value))
|
|
76
|
+
return
|
|
149
77
|
}
|
|
150
|
-
|
|
151
|
-
emit('update:modelValue', code.value)
|
|
78
|
+
catch { /* Preserve incomplete input while typing JSON. */ }
|
|
152
79
|
}
|
|
153
|
-
|
|
154
|
-
// Move cursor position after the inserted tab
|
|
155
|
-
setTimeout(() => {
|
|
156
|
-
target.selectionStart = start + 2
|
|
157
|
-
target.selectionEnd = start + 2
|
|
158
|
-
}, 0)
|
|
80
|
+
emit('update:modelValue', value)
|
|
159
81
|
}
|
|
160
|
-
|
|
161
|
-
// Lifecycle
|
|
162
|
-
onMounted(async () => {
|
|
163
|
-
await loadHighlight()
|
|
164
|
-
})
|
|
165
|
-
|
|
166
|
-
watch(() => props.theme, (t) => { setTheme(t) })
|
|
167
82
|
function syncFromModel() {
|
|
168
|
-
const
|
|
169
|
-
if (
|
|
170
|
-
code.value = newCodeStr
|
|
171
|
-
}
|
|
83
|
+
const value = valueToString(props.modelValue)
|
|
84
|
+
if (value !== code.value) code.value = value
|
|
172
85
|
}
|
|
173
|
-
|
|
174
86
|
function handleBlur() {
|
|
175
87
|
isFocused.value = false
|
|
176
88
|
syncFromModel()
|
|
177
89
|
}
|
|
178
|
-
|
|
179
|
-
watch(() => props.modelValue, () => {
|
|
180
|
-
// Don't overwrite user edits when focused (avoids sync race with parent form state)
|
|
90
|
+
watch(() => props.modelValue, value => {
|
|
181
91
|
if (isFocused.value) return
|
|
92
|
+
objectMode.value = typeof value === 'object'
|
|
182
93
|
syncFromModel()
|
|
183
|
-
}
|
|
94
|
+
})
|
|
184
95
|
</script>
|
|
185
96
|
|
|
186
97
|
<template>
|
|
187
98
|
<div
|
|
188
|
-
class="bagel-input code-editor-container ltr
|
|
189
|
-
:
|
|
99
|
+
class="bagel-input code-editor-container ltr flex flex-column"
|
|
100
|
+
:class="[shellClass, { 'has-value': hasCodeValue, 'single-line': singleLine, terminal }]"
|
|
101
|
+
:style="[{ height: editorHeight, '--code-max-height': maxHeight }, shellStyle]"
|
|
190
102
|
>
|
|
191
|
-
<label v-if="label" class="label">{{ label }}</label>
|
|
192
|
-
<div
|
|
193
|
-
v-if="terminal"
|
|
194
|
-
class="code-terminal-bar monospace flex gap-05 py-05 px-075 txt11 line-height-1 border-bottom"
|
|
195
|
-
>
|
|
103
|
+
<label v-if="label" class="code-label">{{ label }}</label>
|
|
104
|
+
<div v-if="terminal" class="code-terminal-bar monospace flex flex-shrink-0 gap-05 py-05 px-075 txt11 line-height-1 border-bottom">
|
|
196
105
|
<span class="inline-flex gap-025 flex-shrink-0" aria-hidden="true">
|
|
197
106
|
<span class="square-10 round bg-red" />
|
|
198
107
|
<span class="square-10 round bg-yellow" />
|
|
@@ -200,24 +109,23 @@ watch(() => props.modelValue, () => {
|
|
|
200
109
|
</span>
|
|
201
110
|
<span v-if="title" class="opacity-5 ellipsis-1">{{ title }}</span>
|
|
202
111
|
</div>
|
|
203
|
-
<
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
:
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
</div>
|
|
112
|
+
<StructuredEditor
|
|
113
|
+
:model-value="code"
|
|
114
|
+
:language="objectMode && language === 'html' ? 'json' : language"
|
|
115
|
+
:line-numbers="lineNumbers"
|
|
116
|
+
:folding="folding"
|
|
117
|
+
:formatting="formatting"
|
|
118
|
+
:readonly="readonly"
|
|
119
|
+
:disabled="disabled"
|
|
120
|
+
:wrap="wrap"
|
|
121
|
+
:single-line="singleLine"
|
|
122
|
+
:placeholder="placeholder"
|
|
123
|
+
:label="label"
|
|
124
|
+
:dark="!isLightTheme"
|
|
125
|
+
@update:model-value="updateCode"
|
|
126
|
+
@focus="isFocused = true"
|
|
127
|
+
@blur="handleBlur"
|
|
128
|
+
/>
|
|
221
129
|
</div>
|
|
222
130
|
</template>
|
|
223
131
|
|
|
@@ -225,161 +133,31 @@ watch(() => props.modelValue, () => {
|
|
|
225
133
|
.code-editor-container {
|
|
226
134
|
margin-bottom: 0.5rem;
|
|
227
135
|
height: 100%;
|
|
136
|
+
min-height: 0;
|
|
228
137
|
}
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
display: block;
|
|
232
|
-
text-align: left;
|
|
233
|
-
margin-bottom: 0.25rem;
|
|
234
|
-
}
|
|
235
|
-
|
|
236
|
-
.code-editor-grandpa {
|
|
237
|
-
--code-caret-color: #fff;
|
|
238
|
-
border-radius: var(--code-border-radius, 0.25rem);
|
|
239
|
-
width: 100%;
|
|
240
|
-
height: 100%;
|
|
241
|
-
max-height: var(--code-max-height, none);
|
|
242
|
-
overflow: auto;
|
|
243
|
-
overscroll-behavior: contain;
|
|
244
|
-
padding: 1ch;
|
|
245
|
-
padding-inline-start: 2ch;
|
|
246
|
-
color-scheme: dark;
|
|
247
|
-
}
|
|
248
|
-
|
|
249
|
-
.code-editor-grandpa.theme-light {
|
|
250
|
-
--code-caret-color: #1b1f23;
|
|
251
|
-
color-scheme: light;
|
|
252
|
-
}
|
|
253
|
-
|
|
254
|
-
.code-editor-grandpa:focus-within {
|
|
255
|
-
outline: solid 1px var(--bgl-border-color, #4f575f);
|
|
256
|
-
box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.13);
|
|
257
|
-
}
|
|
258
|
-
.code-editor-grandpa textarea.code-input{
|
|
259
|
-
box-shadow: none !important;
|
|
260
|
-
background: transparent !important;
|
|
261
|
-
border-radius: 0 !important;
|
|
262
|
-
|
|
263
|
-
}
|
|
264
|
-
|
|
265
|
-
.editor-content-papa {
|
|
266
|
-
/* Stack pre + textarea in one cell so both share the content-sized box */
|
|
267
|
-
display: grid;
|
|
268
|
-
min-width: 100%;
|
|
269
|
-
width: max-content;
|
|
270
|
-
min-height: 100%;
|
|
271
|
-
/* Cover the scrollable overflow area (grandpa bg doesn't paint past its box) */
|
|
272
|
-
background: inherit;
|
|
138
|
+
.code-editor-container > :deep(.structured-editor) {
|
|
139
|
+
flex: 1;
|
|
273
140
|
}
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
.
|
|
277
|
-
.code-placeholder {
|
|
278
|
-
grid-area: 1 / 1;
|
|
279
|
-
box-sizing: border-box;
|
|
280
|
-
margin: 0;
|
|
281
|
-
/* Extra line so caret can sit on a trailing empty line */
|
|
282
|
-
padding: 0 0 1.5em;
|
|
283
|
-
min-width: 100%;
|
|
284
|
-
width: auto;
|
|
285
|
-
height: auto;
|
|
286
|
-
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
|
|
287
|
-
font-size: 1em;
|
|
288
|
-
font-variant-ligatures: none;
|
|
289
|
-
letter-spacing: normal;
|
|
290
|
-
line-height: 1.5;
|
|
291
|
-
tab-size: 2;
|
|
292
|
-
/* Match wrapping: pre defaults to `pre`, textarea to `pre-wrap` */
|
|
293
|
-
white-space: pre;
|
|
294
|
-
overflow-wrap: normal;
|
|
295
|
-
word-break: normal;
|
|
141
|
+
.code-label {
|
|
142
|
+
flex-shrink: 0;
|
|
143
|
+
margin-bottom: 0.25rem;
|
|
296
144
|
text-align: left;
|
|
297
|
-
border: none;
|
|
298
|
-
}
|
|
299
|
-
|
|
300
|
-
.code-display {
|
|
301
|
-
pointer-events: none;
|
|
302
|
-
z-index: 1;
|
|
303
|
-
}
|
|
304
|
-
|
|
305
|
-
.code-placeholder {
|
|
306
|
-
pointer-events: none;
|
|
307
|
-
opacity: 0.4;
|
|
308
|
-
z-index: 1;
|
|
309
|
-
}
|
|
310
|
-
|
|
311
|
-
.code-display code {
|
|
312
|
-
display: block;
|
|
313
|
-
background: transparent !important;
|
|
314
|
-
padding: 0 !important;
|
|
315
|
-
}
|
|
316
|
-
|
|
317
|
-
.code-input {
|
|
318
|
-
width: 100%;
|
|
319
|
-
height: 100%;
|
|
320
|
-
background: transparent;
|
|
321
|
-
color: transparent;
|
|
322
|
-
-webkit-text-fill-color: transparent;
|
|
323
|
-
caret-color: var(--code-caret-color);
|
|
324
|
-
resize: none;
|
|
325
|
-
outline: none;
|
|
326
|
-
/* Grandpa handles scrolling — avoid a second scrollbar */
|
|
327
|
-
overflow: hidden;
|
|
328
|
-
z-index: 2;
|
|
329
|
-
}
|
|
330
|
-
|
|
331
|
-
.code-input::selection {
|
|
332
|
-
background-color: rgba(36, 102, 188, 0.3);
|
|
333
|
-
color: transparent;
|
|
334
|
-
-webkit-text-fill-color: transparent;
|
|
335
|
-
}
|
|
336
|
-
|
|
337
|
-
/* Wrap mode: long lines break onto the next line instead of scrolling.
|
|
338
|
-
The content box must fill the width so wrapping has a boundary to break at. */
|
|
339
|
-
.code-editor-grandpa.code-wrap {
|
|
340
|
-
overflow-x: hidden;
|
|
341
145
|
}
|
|
342
|
-
|
|
343
|
-
.code-editor-grandpa.code-wrap .editor-content-papa {
|
|
344
|
-
width: 100%;
|
|
345
|
-
}
|
|
346
|
-
|
|
347
|
-
.code-editor-grandpa.code-wrap .code-display,
|
|
348
|
-
.code-editor-grandpa.code-wrap .code-input,
|
|
349
|
-
.code-editor-grandpa.code-wrap .code-placeholder {
|
|
350
|
-
white-space: pre-wrap;
|
|
351
|
-
overflow-wrap: anywhere;
|
|
352
|
-
word-break: break-word;
|
|
353
|
-
}
|
|
354
|
-
|
|
355
146
|
.code-editor-container.single-line {
|
|
356
147
|
height: auto;
|
|
357
148
|
margin-bottom: 0;
|
|
358
149
|
}
|
|
359
|
-
|
|
360
|
-
.code-editor-container.single-line .code-editor-grandpa {
|
|
150
|
+
.single-line > :deep(.structured-editor) {
|
|
361
151
|
height: var(--bgl-input-height);
|
|
362
|
-
|
|
363
|
-
padding-inline: 0.7rem;
|
|
364
|
-
overflow-x: auto;
|
|
365
|
-
overflow-y: hidden;
|
|
152
|
+
flex: none;
|
|
366
153
|
background: var(--bgl-input-bg);
|
|
367
154
|
border-radius: var(--bgl-input-border-radius);
|
|
368
|
-
|
|
155
|
+
font-size: var(--bgl-input-font-size);
|
|
369
156
|
}
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
.code-editor-container.single-line .code-input,
|
|
373
|
-
.code-editor-container.single-line .code-placeholder {
|
|
374
|
-
padding: 0;
|
|
157
|
+
.single-line :deep(.cm-content) {
|
|
158
|
+
padding-block: 0;
|
|
375
159
|
line-height: var(--bgl-input-height);
|
|
376
|
-
font-size: var(--bgl-input-font-size);
|
|
377
|
-
white-space: pre;
|
|
378
160
|
}
|
|
379
|
-
|
|
380
|
-
/* ── Terminal window variant ─────────────────────────────────────────────────
|
|
381
|
-
A console/CI-log surface with a traffic-light title bar. Surface and ink come
|
|
382
|
-
from the project's `--bgl-code-bg` / `--bgl-code-color` tokens. */
|
|
383
161
|
.code-editor-container.terminal {
|
|
384
162
|
padding: 0;
|
|
385
163
|
margin-bottom: 0;
|
|
@@ -389,25 +167,7 @@ watch(() => props.modelValue, () => {
|
|
|
389
167
|
border: 1px solid var(--bgl-border-color);
|
|
390
168
|
border-radius: calc(var(--bgl-radius, 6px) * 2);
|
|
391
169
|
}
|
|
392
|
-
|
|
393
170
|
.code-terminal-bar {
|
|
394
171
|
background: rgba(255, 255, 255, 0.04);
|
|
395
172
|
}
|
|
396
|
-
|
|
397
|
-
.code-editor-container.terminal .code-editor-grandpa {
|
|
398
|
-
flex: 1 1 auto;
|
|
399
|
-
height: auto;
|
|
400
|
-
min-height: 0;
|
|
401
|
-
background: transparent;
|
|
402
|
-
border-radius: 0;
|
|
403
|
-
padding: 0.75rem;
|
|
404
|
-
}
|
|
405
|
-
</style>
|
|
406
|
-
|
|
407
|
-
<style>
|
|
408
|
-
/* Global styles */
|
|
409
|
-
pre code.hljs {
|
|
410
|
-
padding: 0 !important;
|
|
411
|
-
background: transparent !important;
|
|
412
|
-
}
|
|
413
173
|
</style>
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { ref, useId, watch } from 'vue'
|
|
3
|
+
import { SearchQuery, closeSearchPanel, findNext, findPrevious, replaceAll, replaceNext, selectMatches, setSearchQuery } from '@codemirror/search'
|
|
4
|
+
import type { EditorView } from '@codemirror/view'
|
|
5
|
+
import Btn from '../../../Btn.vue'
|
|
6
|
+
import TextInput from '../TextInput.vue'
|
|
7
|
+
|
|
8
|
+
const props = defineProps<{ view: EditorView; query: SearchQuery; readonly: boolean }>()
|
|
9
|
+
const searchText = ref(props.query.search)
|
|
10
|
+
const replacement = ref(props.query.replace)
|
|
11
|
+
const caseSensitive = ref(props.query.caseSensitive)
|
|
12
|
+
const regexp = ref(props.query.regexp)
|
|
13
|
+
const wholeWord = ref(props.query.wholeWord)
|
|
14
|
+
const replaceExpanded = ref(false)
|
|
15
|
+
const replaceId = useId()
|
|
16
|
+
let syncingQuery = false
|
|
17
|
+
|
|
18
|
+
watch(() => props.query, query => {
|
|
19
|
+
syncingQuery = true
|
|
20
|
+
searchText.value = query.search
|
|
21
|
+
replacement.value = query.replace
|
|
22
|
+
caseSensitive.value = query.caseSensitive
|
|
23
|
+
regexp.value = query.regexp
|
|
24
|
+
wholeWord.value = query.wholeWord
|
|
25
|
+
syncingQuery = false
|
|
26
|
+
})
|
|
27
|
+
watch([searchText, replacement, caseSensitive, regexp, wholeWord], () => {
|
|
28
|
+
if (syncingQuery) return
|
|
29
|
+
const query = new SearchQuery({
|
|
30
|
+
search: searchText.value, replace: replacement.value,
|
|
31
|
+
caseSensitive: caseSensitive.value, regexp: regexp.value, wholeWord: wholeWord.value,
|
|
32
|
+
})
|
|
33
|
+
if (!query.eq(props.query)) props.view.dispatch({ effects: setSearchQuery.of(query) })
|
|
34
|
+
}, { flush: 'sync' })
|
|
35
|
+
|
|
36
|
+
function keydown(event: KeyboardEvent) {
|
|
37
|
+
if (event.key === 'Escape') {
|
|
38
|
+
event.preventDefault()
|
|
39
|
+
closeSearchPanel(props.view)
|
|
40
|
+
props.view.focus()
|
|
41
|
+
}
|
|
42
|
+
else if (event.key === 'Enter') {
|
|
43
|
+
event.preventDefault()
|
|
44
|
+
if (event.shiftKey) findPrevious(props.view)
|
|
45
|
+
else findNext(props.view)
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
</script>
|
|
49
|
+
|
|
50
|
+
<template>
|
|
51
|
+
<div class="code-search-panel grid gap-025 p-05" :style="{ position: 'absolute', right: '1rem', opacity: 0.9 }" role="search" aria-label="Find and replace" @keydown="keydown">
|
|
52
|
+
<div class="flex align-items-center gap-025">
|
|
53
|
+
<Btn
|
|
54
|
+
v-if="!readonly" v-tooltip="replaceExpanded ? 'Hide replace' : 'Show replace'" thin flat
|
|
55
|
+
:icon="replaceExpanded ? 'expand_more' : 'chevron_right'" aria-label="Toggle replace"
|
|
56
|
+
:aria-expanded="replaceExpanded" :aria-controls="replaceId" @click="replaceExpanded = !replaceExpanded"
|
|
57
|
+
/>
|
|
58
|
+
<div class="code-search-field flex-1 min-w-0">
|
|
59
|
+
<TextInput
|
|
60
|
+
v-model="searchText" small placeholder="Find" class="min-w-0"
|
|
61
|
+
:native-input-attrs="{ 'aria-label': 'Find', 'main-field': 'true', name: 'search' }"
|
|
62
|
+
/>
|
|
63
|
+
<div class="code-search-options flex align-items-center">
|
|
64
|
+
<Btn v-tooltip="'Match case'" thin :flat="!caseSensitive" :soft="caseSensitive" icon="match_case" aria-label="Match case" :aria-pressed="caseSensitive" @click="caseSensitive = !caseSensitive" />
|
|
65
|
+
<Btn v-tooltip="'Match whole word'" thin :flat="!wholeWord" :soft="wholeWord" icon="match_word" aria-label="Match whole word" :aria-pressed="wholeWord" @click="wholeWord = !wholeWord" />
|
|
66
|
+
<Btn v-tooltip="'Regular expression'" thin :flat="!regexp" :soft="regexp" icon="regular_expression" aria-label="Regular expression" :aria-pressed="regexp" @click="regexp = !regexp" />
|
|
67
|
+
</div>
|
|
68
|
+
</div>
|
|
69
|
+
<Btn v-tooltip="'Previous match (Shift+Enter)'" thin flat icon="arrow_upward" aria-label="Previous match" @click="findPrevious(view)" />
|
|
70
|
+
<Btn v-tooltip="'Next match (Enter)'" thin flat icon="arrow_downward" aria-label="Next match" @click="findNext(view)" />
|
|
71
|
+
<Btn v-tooltip="'Select all matches'" thin flat icon="select_all" aria-label="Select all matches" @click="selectMatches(view)" />
|
|
72
|
+
<Btn v-tooltip="'Close (Escape)'" thin flat icon="close" aria-label="Close search" @click="closeSearchPanel(view); view.focus()" />
|
|
73
|
+
</div>
|
|
74
|
+
<div v-if="!readonly && replaceExpanded" :id="replaceId" class="code-replace-row flex align-items-center gap-025">
|
|
75
|
+
<TextInput
|
|
76
|
+
v-model="replacement" small dense placeholder="Replace" class="flex-1 min-w-0"
|
|
77
|
+
:native-input-attrs="{ 'aria-label': 'Replace', name: 'replace' }"
|
|
78
|
+
/>
|
|
79
|
+
<Btn v-tooltip="'Replace next'" thin flat icon="find_replace" aria-label="Replace next" @click="replaceNext(view)" />
|
|
80
|
+
<Btn v-tooltip="'Replace all'" thin flat icon="published_with_changes" aria-label="Replace all" @click="replaceAll(view)" />
|
|
81
|
+
</div>
|
|
82
|
+
<span v-if="query.regexp && query.search.length > 0 && !query.valid" class="txt12 color-red" role="alert">Invalid regular expression</span>
|
|
83
|
+
</div>
|
|
84
|
+
</template>
|
|
85
|
+
|
|
86
|
+
<style scoped>
|
|
87
|
+
.code-search-panel {
|
|
88
|
+
font-family: var(--bgl-font-family, sans-serif);
|
|
89
|
+
color: var(--bgl-color, inherit);
|
|
90
|
+
background: var(--bgl-input-bg, transparent);
|
|
91
|
+
width: min(calc(100% - 2rem), 540px);
|
|
92
|
+
z-index: 10;
|
|
93
|
+
margin-inline-start: auto;
|
|
94
|
+
box-sizing: border-box;
|
|
95
|
+
}
|
|
96
|
+
.code-search-field {
|
|
97
|
+
display: grid;
|
|
98
|
+
grid-template-columns: minmax(0, 1fr) auto;
|
|
99
|
+
align-items: center;
|
|
100
|
+
}
|
|
101
|
+
.code-search-field > :deep(.bagel-input) {
|
|
102
|
+
grid-area: 1 / 1 / 2 / 3;
|
|
103
|
+
margin-bottom: 0;
|
|
104
|
+
}
|
|
105
|
+
.code-search-field :deep(input) {
|
|
106
|
+
padding-inline-end: 5rem;
|
|
107
|
+
}
|
|
108
|
+
.code-search-options {
|
|
109
|
+
grid-area: 1 / 2;
|
|
110
|
+
z-index: 1;
|
|
111
|
+
}
|
|
112
|
+
.code-search-panel :deep(.bgl_btn-icon) {
|
|
113
|
+
width: 24px;
|
|
114
|
+
height: 24px;
|
|
115
|
+
min-width: 24px;
|
|
116
|
+
padding: 2px;
|
|
117
|
+
}
|
|
118
|
+
.code-replace-row {
|
|
119
|
+
padding-inline-start: 28px;
|
|
120
|
+
}
|
|
121
|
+
.code-replace-row > :deep(.bagel-input) {
|
|
122
|
+
margin-bottom: 0;
|
|
123
|
+
}
|
|
124
|
+
</style>
|