@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.
Files changed (70) hide show
  1. package/dist/StructuredEditor-B-Vp4pa2.cjs +2 -0
  2. package/dist/StructuredEditor-DWfRtYZa.js +2431 -0
  3. package/dist/StructuredEditor.css +1 -0
  4. package/dist/babel-BVvTH0ev.js +10053 -0
  5. package/dist/babel-BzIDwrmk.cjs +16 -0
  6. package/dist/components/form/inputs/CodeEditor/Index.vue.d.ts +45 -28
  7. package/dist/components/form/inputs/CodeEditor/Index.vue.d.ts.map +1 -1
  8. package/dist/components/form/inputs/CodeEditor/SearchPanel.vue.d.ts +10 -0
  9. package/dist/components/form/inputs/CodeEditor/SearchPanel.vue.d.ts.map +1 -0
  10. package/dist/components/form/inputs/CodeEditor/StructuredEditor.vue.d.ts +27 -0
  11. package/dist/components/form/inputs/CodeEditor/StructuredEditor.vue.d.ts.map +1 -0
  12. package/dist/components/form/inputs/CodeEditor/formatCode.d.ts +4 -0
  13. package/dist/components/form/inputs/CodeEditor/formatCode.d.ts.map +1 -0
  14. package/dist/components/form/inputs/DatePicker.vue.d.ts.map +1 -1
  15. package/dist/components/form/inputs/OTP.vue.d.ts +2 -2
  16. package/dist/components/form/inputs/OTP.vue.d.ts.map +1 -1
  17. package/dist/components/form/inputs/RichText/index.vue.d.ts.map +1 -1
  18. package/dist/core.css +3 -1
  19. package/dist/dist-B-MCiFKR.cjs +10 -0
  20. package/dist/dist-B0uc2InW.js +6 -0
  21. package/dist/dist-BIAEQGHn.cjs +1 -0
  22. package/dist/dist-BLxHnfU6.js +1071 -0
  23. package/dist/dist-BRA2DQF2.cjs +1 -0
  24. package/dist/dist-BnLdfA7w.js +69 -0
  25. package/dist/dist-CL50Ff42.cjs +1 -0
  26. package/dist/dist-CwUttjIh.js +1100 -0
  27. package/dist/dist-CzY35u4H.cjs +1 -0
  28. package/dist/dist-D8OWrPLr.js +1336 -0
  29. package/dist/dist-DSCI9g6w.cjs +13 -0
  30. package/dist/dist-DsBgijLf.cjs +1 -0
  31. package/dist/dist-GbVY_Jpv.cjs +1 -0
  32. package/dist/dist-IV7z-zur.js +11909 -0
  33. package/dist/dist-Mr0UMyoK.js +1063 -0
  34. package/dist/dist-jq7acmcZ.js +6 -0
  35. package/dist/estree-CKgw47OZ.js +8211 -0
  36. package/dist/estree-HqeJuE3g.cjs +44 -0
  37. package/dist/html-B-hsQYII.js +7289 -0
  38. package/dist/html-BrqW5pT-.cjs +25 -0
  39. package/dist/index.cjs +1 -764
  40. package/dist/index.mjs +308 -65621
  41. package/dist/postcss-Bk65KKdh.js +6703 -0
  42. package/dist/postcss-BxY0xtVZ.cjs +61 -0
  43. package/dist/src-DwJEyASG.js +65571 -0
  44. package/dist/src-Uy-ww1Nz.cjs +764 -0
  45. package/dist/src.css +1 -0
  46. package/dist/standalone-CAcRm_h6.cjs +29 -0
  47. package/dist/standalone-D-HcbQmf.js +3549 -0
  48. package/dist/style.css +3 -1
  49. package/dist/utils/calendarDate.d.ts +6 -0
  50. package/dist/utils/calendarDate.d.ts.map +1 -0
  51. package/dist/utils/date.d.ts.map +1 -1
  52. package/package.json +13 -2
  53. package/src/components/form/inputs/CodeEditor/Index.vue +70 -310
  54. package/src/components/form/inputs/CodeEditor/SearchPanel.vue +124 -0
  55. package/src/components/form/inputs/CodeEditor/StructuredEditor.vue +266 -0
  56. package/src/components/form/inputs/CodeEditor/formatCode.ts +34 -0
  57. package/src/components/form/inputs/DatePicker.vue +4 -1
  58. package/src/components/form/inputs/OTP.vue +42 -19
  59. package/src/components/form/inputs/RichText/index.vue +2 -1
  60. package/src/utils/calendarDate.ts +16 -0
  61. package/src/utils/date.ts +2 -1
  62. package/vite.config.ts +5 -3
  63. package/dist/components/form/inputs/CodeEditor/useHighlight.d.ts +0 -33
  64. package/dist/components/form/inputs/CodeEditor/useHighlight.d.ts.map +0 -1
  65. package/dist/index.css +0 -1
  66. package/src/components/form/inputs/CodeEditor/useHighlight.ts +0 -123
  67. /package/dist/{page-flip.browser-BXnk8BM6.js → page-flip.browser-0kqlwcC8.js} +0 -0
  68. /package/dist/{page-flip.browser-ByKQXhqK.cjs → page-flip.browser-Dfy5mAgM.cjs} +0 -0
  69. /package/dist/{pdf-CV7M2d0x.cjs → pdf-BBd7GH-5.cjs} +0 -0
  70. /package/dist/{pdf-DuN3_wNN.js → pdf-scP2ZqGZ.js} +0 -0
@@ -0,0 +1,266 @@
1
+ <script setup lang="ts">
2
+ import { computed, getCurrentInstance, h, onBeforeUnmount, onMounted, ref, render, shallowRef, watch } from 'vue'
3
+ import { Annotation, Compartment, EditorState, type Extension } from '@codemirror/state'
4
+ import { EditorView, keymap, lineNumbers as numberGutter, placeholder as editorPlaceholder } from '@codemirror/view'
5
+ import { defaultKeymap, history, historyKeymap, indentWithTab } from '@codemirror/commands'
6
+ import { bracketMatching, foldGutter, foldKeymap, indentOnInput, indentUnit } from '@codemirror/language'
7
+ import { atomone, atomoneInit } from '@uiw/codemirror-theme-atomone'
8
+ import { getSearchQuery, search, searchKeymap } from '@codemirror/search'
9
+ import SearchPanel from './SearchPanel.vue'
10
+ import Btn from '../../../Btn.vue'
11
+ import { copyText } from '../../../../utils'
12
+ import { formatCode, supportsFormatting } from './formatCode'
13
+
14
+ const props = defineProps<{
15
+ modelValue: string
16
+ language: string
17
+ lineNumbers: boolean
18
+ folding: boolean
19
+ formatting: boolean
20
+ readonly: boolean
21
+ disabled: boolean
22
+ wrap: boolean
23
+ singleLine: boolean
24
+ placeholder: string
25
+ label: string
26
+ dark: boolean
27
+ }>()
28
+ const emit = defineEmits<{
29
+ 'update:modelValue': [value: string]
30
+ focus: []
31
+ blur: []
32
+ }>()
33
+
34
+ const host = ref<HTMLDivElement>()
35
+ const formattingBusy = ref(false)
36
+ const formatError = ref('')
37
+ const copied = ref(false)
38
+ const copyError = ref('')
39
+ let copyTimer: ReturnType<typeof setTimeout> | undefined
40
+ const languageNames: Record<string, string> = { javascript: 'JS', typescript: 'TS' }
41
+ const languageLabel = computed(() => languageNames[props.language] || props.language.toUpperCase())
42
+ const canFormat = computed(() => props.formatting && !props.singleLine && supportsFormatting(props.language))
43
+ const config = new Compartment()
44
+ const languageConfig = new Compartment()
45
+ const externalUpdate = Annotation.define<boolean>()
46
+ let view: EditorView | undefined
47
+ let languageRequest = 0
48
+ let disposed = false
49
+ async function copy() {
50
+ copyError.value = ''
51
+ try {
52
+ await copyText(view?.state.doc.toString() ?? props.modelValue)
53
+ copied.value = true
54
+ clearTimeout(copyTimer)
55
+ copyTimer = setTimeout(() => { copied.value = false }, 2000)
56
+ }
57
+ catch {
58
+ copyError.value = 'Could not copy. Check clipboard permissions and try again.'
59
+ }
60
+ }
61
+ const appContext = getCurrentInstance()!.appContext
62
+ const atomLight = atomoneInit({
63
+ theme: 'light',
64
+ settings: {
65
+ background: '#fafafa',
66
+ foreground: '#383a42',
67
+ caret: '#526fff',
68
+ selection: '#d7d7d7',
69
+ selectionMatch: '#e5e5e6',
70
+ lineHighlight: '#f0f0f0',
71
+ gutterBackground: '#fafafa',
72
+ gutterForeground: '#9d9d9f',
73
+ },
74
+ })
75
+
76
+ function createSearchPanel(editor: EditorView) {
77
+ const dom = document.createElement('div')
78
+ const query = shallowRef(getSearchQuery(editor.state))
79
+ const readonly = ref(editor.state.readOnly)
80
+ const vnode = h({
81
+ setup: () => () => h(SearchPanel, { view: editor, query: query.value, readonly: readonly.value }),
82
+ })
83
+ vnode.appContext = appContext
84
+ render(vnode, dom)
85
+ return {
86
+ dom,
87
+ top: true,
88
+ update() {
89
+ query.value = getSearchQuery(editor.state)
90
+ readonly.value = editor.state.readOnly
91
+ },
92
+ destroy() { render(null, dom) },
93
+ }
94
+ }
95
+
96
+ function extensions(): Extension[] {
97
+ return [
98
+ props.dark ? atomone : atomLight,
99
+ props.lineNumbers && !props.singleLine ? numberGutter() : [],
100
+ props.folding && !props.singleLine ? [foldGutter(), keymap.of(foldKeymap)] : [],
101
+ props.wrap ? EditorView.lineWrapping : [],
102
+ EditorState.readOnly.of(props.readonly || props.disabled),
103
+ EditorView.editable.of(!props.readonly && !props.disabled),
104
+ EditorView.contentAttributes.of({
105
+ 'aria-label': props.label || 'Code editor',
106
+ 'aria-disabled': String(props.disabled),
107
+ }),
108
+ editorPlaceholder(props.placeholder),
109
+ EditorView.theme({
110
+ '&': { height: '100%' },
111
+ '.cm-scroller': { overflow: 'auto', fontFamily: 'inherit', lineHeight: '1.5' },
112
+ '.cm-content': { padding: '8px 0' },
113
+ '&.cm-focused': { outline: 'none' },
114
+ }, { dark: props.dark }),
115
+ ]
116
+ }
117
+
118
+ async function loadLanguage() {
119
+ const request = ++languageRequest
120
+ let extension: Extension = []
121
+ switch (props.language) {
122
+ case 'html':
123
+ case 'xml':
124
+ extension = (await import('@codemirror/lang-html')).html()
125
+ break
126
+ case 'javascript':
127
+ case 'js':
128
+ case 'typescript':
129
+ case 'ts':
130
+ extension = (await import('@codemirror/lang-javascript')).javascript({ typescript: ['typescript', 'ts'].includes(props.language) })
131
+ break
132
+ case 'json':
133
+ extension = (await import('@codemirror/lang-json')).json()
134
+ break
135
+ case 'css':
136
+ extension = (await import('@codemirror/lang-css')).css()
137
+ break
138
+ }
139
+ if (!disposed && request === languageRequest)
140
+ view?.dispatch({ effects: languageConfig.reconfigure(extension) })
141
+ }
142
+
143
+ function requestLanguage() {
144
+ void loadLanguage().catch(() => {
145
+ if (!disposed) formatError.value = 'Could not load syntax support. Plain-text editing is still available.'
146
+ })
147
+ }
148
+
149
+ async function format() {
150
+ if (!view || !canFormat.value || props.readonly || props.disabled || formattingBusy.value) return
151
+ const original = view.state.doc
152
+ const language = props.language
153
+ formattingBusy.value = true
154
+ formatError.value = ''
155
+ try {
156
+ const formatted = await formatCode(original.toString(), language)
157
+ // Don't replace edits or a newly supplied value while the formatter downloads.
158
+ if (view && view.state.doc === original && props.language === language && !props.readonly && !props.disabled) {
159
+ view.dispatch({
160
+ changes: { from: 0, to: original.length, insert: formatted },
161
+ userEvent: 'input.format',
162
+ })
163
+ view.focus()
164
+ }
165
+ }
166
+ catch {
167
+ formatError.value = 'Could not format this code. Check its syntax and try again.'
168
+ }
169
+ finally {
170
+ formattingBusy.value = false
171
+ }
172
+ }
173
+
174
+ onMounted(() => {
175
+ view = new EditorView({
176
+ parent: host.value,
177
+ state: EditorState.create({
178
+ doc: props.modelValue,
179
+ extensions: [
180
+ config.of(extensions()),
181
+ languageConfig.of([]),
182
+ history(),
183
+ indentUnit.of(' '),
184
+ indentOnInput(),
185
+ bracketMatching(),
186
+ search({ createPanel: createSearchPanel }),
187
+ keymap.of([
188
+ { key: 'Enter', run: () => props.singleLine },
189
+ ...defaultKeymap, ...historyKeymap, ...searchKeymap,
190
+ indentWithTab,
191
+ ]),
192
+ EditorState.transactionFilter.of(transaction => {
193
+ if (props.singleLine && transaction.docChanged && transaction.newDoc.lines > 1) return []
194
+ return transaction
195
+ }),
196
+ EditorView.updateListener.of(update => {
197
+ if (update.docChanged && !update.transactions.some(transaction => transaction.annotation(externalUpdate)))
198
+ emit('update:modelValue', update.state.doc.toString())
199
+ if (update.focusChanged) {
200
+ if (update.view.hasFocus) emit('focus')
201
+ else emit('blur')
202
+ }
203
+ }),
204
+ ],
205
+ }),
206
+ })
207
+ requestLanguage()
208
+ })
209
+
210
+ watch(() => props.modelValue, value => {
211
+ if (view && value !== view.state.doc.toString())
212
+ view.dispatch({
213
+ changes: { from: 0, to: view.state.doc.length, insert: value },
214
+ annotations: externalUpdate.of(true),
215
+ })
216
+ })
217
+ watch(() => props.language, requestLanguage)
218
+ watch(() => [props.lineNumbers, props.folding, props.readonly, props.disabled, props.wrap, props.singleLine, props.placeholder, props.label, props.dark], () => {
219
+ view?.dispatch({ effects: config.reconfigure(extensions()) })
220
+ })
221
+ onBeforeUnmount(() => {
222
+ disposed = true
223
+ clearTimeout(copyTimer)
224
+ view?.destroy()
225
+ view = undefined
226
+ })
227
+ </script>
228
+
229
+ <template>
230
+ <div class="structured-editor monospace">
231
+ <div v-if="!singleLine" class="flex flex-shrink-0 align-items-center space-between gap-05 px-075 py-025">
232
+ <span class="txt11 opacity-5" aria-label="Code language">{{ languageLabel }}</span>
233
+ <div class="flex align-items-center gap-025">
234
+ <Btn
235
+ v-if="canFormat" v-tooltip="formattingBusy ? 'Formatting…' : 'Format code'" thin flat
236
+ icon="format_align_left" aria-label="Format code" :aria-busy="formattingBusy"
237
+ :disabled="readonly || disabled || formattingBusy" @click="format"
238
+ />
239
+ <Btn
240
+ v-tooltip="copied ? 'Copied!' : 'Copy code'" thin flat
241
+ :icon="copied ? 'check' : 'content_copy'" :aria-label="copied ? 'Copied!' : 'Copy code'"
242
+ @click="copy"
243
+ />
244
+ <span class="hide" role="status">{{ copied ? 'Copied to clipboard' : '' }}</span>
245
+ </div>
246
+ </div>
247
+ <span v-if="formatError || copyError" role="alert" class="txt12 color-red px-075">{{ formatError || copyError }}</span>
248
+ <div ref="host" class="structured-editor-host" />
249
+ </div>
250
+ </template>
251
+
252
+ <style scoped>
253
+ .structured-editor {
254
+ display: flex;
255
+ flex-direction: column;
256
+ height: 100%;
257
+ min-height: 0;
258
+ max-height: var(--code-max-height, none);
259
+ overflow: hidden;
260
+ }
261
+ .structured-editor-host {
262
+ flex: 1;
263
+ min-height: 0;
264
+ overflow: auto;
265
+ }
266
+ </style>
@@ -0,0 +1,34 @@
1
+ /** Formatter code and parsers are downloaded only after an explicit format action. */
2
+ export function supportsFormatting(language: string): boolean {
3
+ return ['html', 'xml', 'javascript', 'js', 'typescript', 'ts', 'json', 'css'].includes(language)
4
+ }
5
+
6
+ export async function formatCode(source: string, language: string): Promise<string> {
7
+ const { format } = await import('prettier/standalone')
8
+ const options = { tabWidth: 2, useTabs: false }
9
+ switch (language) {
10
+ case 'html':
11
+ case 'xml': {
12
+ const html = await import('prettier/plugins/html')
13
+ return format(source, { ...options, parser: 'html', plugins: [html], htmlWhitespaceSensitivity: 'strict' })
14
+ }
15
+ case 'css': {
16
+ const postcss = await import('prettier/plugins/postcss')
17
+ return format(source, { ...options, parser: 'css', plugins: [postcss] })
18
+ }
19
+ case 'json':
20
+ case 'javascript':
21
+ case 'js':
22
+ case 'typescript':
23
+ case 'ts': {
24
+ const [babel, estree] = await Promise.all([
25
+ import('prettier/plugins/babel'),
26
+ import('prettier/plugins/estree'),
27
+ ])
28
+ const parser = language === 'json' ? 'json' : ['typescript', 'ts'].includes(language) ? 'babel-ts' : 'babel'
29
+ return format(source, { ...options, parser, plugins: [babel, estree] })
30
+ }
31
+ default:
32
+ return source
33
+ }
34
+ }
@@ -4,6 +4,7 @@ import type { ModeType } from '../../../utils/calendar/typings'
4
4
  import { Btn, NumberInput, local } from '../../../index'
5
5
  import { computed, ref, toValue } from 'vue'
6
6
  import Time, { WEEK_START_DAY } from '../../../utils/calendar/time'
7
+ import { parseCalendarDate } from '../../../utils/calendarDate'
7
8
 
8
9
  export interface DateRangeValue {
9
10
  start?: string
@@ -58,7 +59,9 @@ const time = new Time(props.firstDayOfWeek, props.locale)
58
59
  // Parse a date string or object into a Date object
59
60
  function parseDate(value: string | Date | undefined): Date | null {
60
61
  if (!value) { return null }
61
- const date = typeof value === 'string' ? new Date(value) : value
62
+ const date = typeof value === 'string'
63
+ ? (props.enableTime ? new Date(value) : parseCalendarDate(value))
64
+ : value
62
65
  return Number.isNaN(date.getTime()) ? null : date
63
66
  }
64
67
 
@@ -10,9 +10,9 @@ const props = defineProps<{
10
10
  error?: string
11
11
  /** Color of the entered digits. Accepts any CSS color or theme var (e.g. "primary", "var(--bgl-primary)", "#e11d48"). */
12
12
  color?: string
13
- /** Size of each digit box (width & height). Accepts any CSS length (e.g. "2.5rem", "40px"). Default: 3rem. */
13
+ /** Size of each digit box (sets --otp-input-width & --otp-input-height). Accepts any CSS length (e.g. "2.5rem", "40px"). Default: 3rem. */
14
14
  size?: string
15
- /** Digit box size below 910px. Falls back to `size` (or 3rem) when omitted. */
15
+ /** Digit box size below 910px (sets --otp-input-mobile-width & --otp-input-mobile-height). Falls back to `size` when omitted. */
16
16
  mobileSize?: string
17
17
  } & BagelInputShellProps>()
18
18
 
@@ -28,9 +28,15 @@ const digitColor = computed(() => {
28
28
 
29
29
  const shellStyle = computed(() => {
30
30
  const style = { ...(baseShellStyle.value ?? {}) } as Record<string, string>
31
- if (digitColor.value) { style['--bgl-otp-digit-color'] = digitColor.value }
32
- if (props.size) { style['--bgl-otp-digit-size'] = props.size }
33
- if (props.mobileSize) { style['--bgl-otp-digit-mobile-size'] = props.mobileSize }
31
+ if (digitColor.value) { style['--otp-input-color'] = digitColor.value }
32
+ if (props.size) {
33
+ style['--otp-input-width'] = props.size
34
+ style['--otp-input-height'] = props.size
35
+ }
36
+ if (props.mobileSize) {
37
+ style['--otp-input-mobile-width'] = props.mobileSize
38
+ style['--otp-input-mobile-height'] = props.mobileSize
39
+ }
34
40
  return Object.keys(style).length > 0 ? style : undefined
35
41
  })
36
42
 
@@ -127,7 +133,7 @@ function focusInput() {
127
133
  color: var(--bgl-red);
128
134
  }
129
135
  .otp_wrap.has-error .digit-box {
130
- outline: 1px solid var(--bgl-red) !important;
136
+ outline: var(--otp-input-outline-width) solid var(--bgl-red) !important;
131
137
  }
132
138
 
133
139
  .otp_wrap {
@@ -162,34 +168,50 @@ outline: none;
162
168
  .otp-hidden-input::selection { background: transparent; }
163
169
 
164
170
  .digit-box {
165
- height: var(--bgl-otp-digit-size, 3rem);
166
- aspect-ratio: 1;
171
+ width: var(--otp-input-width);
172
+ height: var(--otp-input-height);
167
173
  flex: 0 0 auto;
168
- color: var(--bgl-otp-digit-color, inherit);
169
- border: 1px solid var(--bgl-input-label-active-color, var(--bgl-primary-tint));
174
+ color: var(--otp-input-color);
175
+ border: var(--otp-input-border-width) solid var(--bgl-input-label-active-color, var(--bgl-primary-tint));
170
176
  display: inline-flex;
171
177
  align-items: center;
172
178
  justify-content: center;
173
- background: var(--bgl-gray-light);
174
- border-radius: 5px;
175
- margin: 5px;
179
+ background: var(--otp-input-bg);
180
+ border-radius: var(--otp-input-border-radius);
181
+ margin: var(--otp-input-gap);
176
182
  text-align: center;
177
- font-size: calc(var(--bgl-otp-digit-size, 3rem) * 0.8);
183
+ font-size: var(--otp-input-font-size);
184
+ font-weight: var(--otp-input-font-weight);
178
185
  font-variant-numeric: tabular-nums;
179
186
  user-select: none;
180
187
  transition: outline-color 0.2s ease, box-shadow 0.2s ease;
181
188
  }
182
189
 
183
190
  .digit-box.is-active {
184
- outline: 1px solid var(--bgl-input-label-active-color, var(--bgl-primary));
191
+ outline: var(--otp-input-outline-width) solid var(--bgl-input-label-active-color, var(--bgl-primary));
185
192
  filter: drop-shadow(0 0 0.25rem var(--bgl-input-label-active-color, var(--bgl-primary)));
186
- outline-offset: 1px;
193
+ outline-offset: var(--otp-input-outline-offset);
187
194
  }
188
195
 
189
196
  /* ── frame variant ──────────────────────────────────────────────────────── */
190
197
 
191
198
  .otp-input {
192
199
  width: 100%;
200
+ --otp-input-width: var(--bgl-otp-digit-size, 3rem);
201
+ --otp-input-height: var(--bgl-otp-digit-size, 3rem);
202
+ --otp-input-font-size: calc(var(--otp-input-height) * 0.8);
203
+ --otp-input-font-weight: 400;
204
+ --otp-input-border-radius: 5px;
205
+ --otp-input-border-width: 1px;
206
+ --otp-input-outline-width: 1px;
207
+ --otp-input-outline-offset: 1px;
208
+ --otp-input-gap: 5px;
209
+ --otp-input-bg: var(--bgl-gray-light);
210
+ --otp-input-color: var(--bgl-otp-digit-color, inherit);
211
+ --otp-input-mobile-width: var(--bgl-otp-digit-mobile-size, var(--otp-input-width));
212
+ --otp-input-mobile-height: var(--bgl-otp-digit-mobile-size, var(--otp-input-height));
213
+ --otp-input-mobile-font-size: calc(var(--otp-input-mobile-height) * 0.8);
214
+ --otp-input-mobile-padding: 0.25rem;
193
215
  }
194
216
 
195
217
  .otp-input.frame .digit-box {
@@ -216,9 +238,10 @@ outline-offset: -1px;
216
238
 
217
239
  @media screen and (max-width: 910px) {
218
240
  .digit-box {
219
- height: var(--bgl-otp-digit-mobile-size, var(--bgl-otp-digit-size, 3rem));
220
- font-size: calc(var(--bgl-otp-digit-mobile-size, var(--bgl-otp-digit-size, 3rem)) * 0.8);
221
- padding: 0.25rem;
241
+ width: var(--otp-input-mobile-width);
242
+ height: var(--otp-input-mobile-height);
243
+ font-size: var(--otp-input-mobile-font-size);
244
+ padding: var(--otp-input-mobile-padding);
222
245
  }
223
246
  }
224
247
 
@@ -3956,7 +3956,8 @@ const imgTransform = computed({
3956
3956
  />
3957
3957
  </div>
3958
3958
  <CodeEditor
3959
- v-if="editor.state.isSplitView" v-model="splitViewHtml" language="html" :autodetect="false" wrap
3959
+ v-if="editor.state.isSplitView" v-model="splitViewHtml" language="html" wrap
3960
+ line-numbers folding formatting
3960
3961
  :height="editor.state.isFullscreen ? 'calc(100vh - 4rem)' : editorHeight"
3961
3962
  />
3962
3963
  </div>
@@ -0,0 +1,16 @@
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 function parseCalendarDate(value: string | number | Date): Date {
6
+ if (typeof value === 'string') {
7
+ const match = /^(\d{4})-(\d{2})-(\d{2})$/.exec(value)
8
+ if (match) {
9
+ const date = new Date(0)
10
+ date.setFullYear(Number(match[1]), Number(match[2]) - 1, Number(match[3]))
11
+ date.setHours(0, 0, 0, 0)
12
+ return date
13
+ }
14
+ }
15
+ return new Date(value)
16
+ }
package/src/utils/date.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import { getI18n } from '../i18n'
2
+ import { parseCalendarDate } from './calendarDate'
2
3
 
3
4
  function getLocale(): string {
4
5
  try {
@@ -436,7 +437,7 @@ export function formatDate(
436
437
  locale = locale || getLocale()
437
438
 
438
439
  try {
439
- let parsed = new Date(date)
440
+ let parsed = parseCalendarDate(date)
440
441
 
441
442
  // Handle DD.MM.YY(YY) and DD/MM/YY(YY) strings that new Date() can't parse
442
443
  if (typeof date === 'string' && Number.isNaN(parsed.getTime())) {
package/vite.config.ts CHANGED
@@ -37,7 +37,9 @@ function composeCssEntries(): Plugin {
37
37
  : new TextDecoder().decode(asset.source)
38
38
  }
39
39
 
40
- const components = css('index.css')
40
+ // Async component sharing can change the main CSS chunk's name.
41
+ const components = css(bundle['index.css'] ? 'index.css' : 'src.css')
42
+ const editor = bundle['StructuredEditor.css'] ? css('StructuredEditor.css') : ''
41
43
  const core = css('core.css')
42
44
  const adminFonts = css('admin.css')
43
45
  const coreAsset = bundle['core.css']
@@ -48,8 +50,8 @@ function composeCssEntries(): Plugin {
48
50
 
49
51
  // Component styles load first; core utilities intentionally load last.
50
52
  // External imports must be deduplicated and hoisted before all rules.
51
- coreAsset.source = composeCss(components, core)
52
- styleAsset.source = composeCss(components, core, adminFonts)
53
+ coreAsset.source = composeCss(components, editor, core)
54
+ styleAsset.source = composeCss(components, editor, core, adminFonts)
53
55
  },
54
56
  }
55
57
  }
@@ -1,33 +0,0 @@
1
- import { HighlightJS, HighlightTheme } from './CodeTypes';
2
- export declare function useHighlight(theme?: HighlightTheme): {
3
- hljs: import('vue').Ref<{
4
- highlight: (code: string, options: {
5
- language: string;
6
- ignoreIllegals: boolean;
7
- }) => {
8
- value: string;
9
- };
10
- highlightAuto: (code: string) => {
11
- value: string;
12
- };
13
- getLanguage: (name: string) => any;
14
- } | null, HighlightJS | {
15
- highlight: (code: string, options: {
16
- language: string;
17
- ignoreIllegals: boolean;
18
- }) => {
19
- value: string;
20
- };
21
- highlightAuto: (code: string) => {
22
- value: string;
23
- };
24
- getLanguage: (name: string) => any;
25
- } | null>;
26
- loaded: import('vue').Ref<boolean, boolean>;
27
- loadHighlight: () => Promise<void>;
28
- setTheme: (theme: HighlightTheme) => Promise<void>;
29
- currentTheme: import('vue').Ref<HighlightTheme, HighlightTheme>;
30
- escapeHtml: (unsafe: string) => string;
31
- highlightCode: (code: string, language?: string, autodetect?: boolean, ignoreIllegals?: boolean) => string;
32
- };
33
- //# sourceMappingURL=useHighlight.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useHighlight.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/inputs/CodeEditor/useHighlight.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAU9D,wBAAgB,YAAY,CAAC,KAAK,GAAE,cAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;sBA2C3B,cAAc;;yBAyBjB,MAAM;0BAaL,MAAM,aAAa,MAAM;EA+BtD"}