@bagelink/vue 1.2.77 → 1.2.81

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (30) hide show
  1. package/bin/experimentalGenTypedRoutes.ts +13 -2
  2. package/dist/components/AddressSearch.vue.d.ts.map +1 -1
  3. package/dist/components/Carousel2.vue.d.ts +89 -0
  4. package/dist/components/Carousel2.vue.d.ts.map +1 -0
  5. package/dist/components/Dropdown.vue.d.ts.map +1 -1
  6. package/dist/components/Slider.vue.d.ts +4 -3
  7. package/dist/components/Slider.vue.d.ts.map +1 -1
  8. package/dist/components/calendar/views/CalendarPopover.vue.d.ts +2 -2
  9. package/dist/components/calendar/views/CalendarPopover.vue.d.ts.map +1 -1
  10. package/dist/components/form/BagelForm.vue.d.ts +1 -0
  11. package/dist/components/form/BagelForm.vue.d.ts.map +1 -1
  12. package/dist/components/form/BglMultiStepForm.vue.d.ts +7 -4
  13. package/dist/components/form/BglMultiStepForm.vue.d.ts.map +1 -1
  14. package/dist/components/form/inputs/CodeEditor/Index.vue.d.ts +14 -6
  15. package/dist/components/form/inputs/CodeEditor/Index.vue.d.ts.map +1 -1
  16. package/dist/components/form/inputs/RichText/index.vue.d.ts.map +1 -1
  17. package/dist/components/form/inputs/SelectInput.vue.d.ts.map +1 -1
  18. package/dist/index.cjs +173 -143
  19. package/dist/index.mjs +173 -143
  20. package/dist/style.css +206 -176
  21. package/dist/utils/index.d.ts.map +1 -1
  22. package/package.json +1 -1
  23. package/src/components/Slider.vue +13 -11
  24. package/src/components/form/BagelForm.vue +2 -1
  25. package/src/components/form/BglMultiStepForm.vue +47 -32
  26. package/src/components/form/inputs/CodeEditor/Index.vue +160 -98
  27. package/src/components/form/inputs/RichText/index.vue +12 -11
  28. package/src/utils/index.ts +38 -13
  29. package/dist/types/timeago.d.ts +0 -23
  30. package/dist/types/timeago.d.ts.map +0 -1
@@ -15,6 +15,9 @@ const editor = useEditor()
15
15
  const isInitializing = ref(false)
16
16
  const hasInitialized = ref(false)
17
17
 
18
+ // Initialize content from modelValue
19
+ editor.state.content = props.modelValue
20
+
18
21
  // Initialize debugger if debug mode is enabled
19
22
  if (props.debug) {
20
23
  editor.initDebugger()
@@ -83,6 +86,9 @@ async function initEditor() {
83
86
  // Set default direction based on content
84
87
  doc.body.dir = hasRTL ? 'rtl' : 'ltr'
85
88
 
89
+ // Ensure editor.state.content is set to the current HTML content
90
+ editor.state.content = doc.body.innerHTML
91
+
86
92
  editor.init(doc)
87
93
  useEditorKeyboard(doc, commands)
88
94
 
@@ -92,6 +98,8 @@ async function initEditor() {
92
98
  p.dir = doc.body.dir
93
99
  p.innerHTML = '<br>'
94
100
  doc.body.appendChild(p)
101
+ // Update state.content after changes
102
+ editor.state.content = doc.body.innerHTML
95
103
  } else {
96
104
  // Convert any direct text nodes to paragraphs
97
105
  const walker = doc.createTreeWalker(doc.body, NodeFilter.SHOW_TEXT)
@@ -112,6 +120,8 @@ async function initEditor() {
112
120
  doc.body.removeChild(textNode)
113
121
  }
114
122
  })
123
+ // Update state.content after cleanup
124
+ editor.state.content = doc.body.innerHTML
115
125
  }
116
126
 
117
127
  doc.body.focus()
@@ -168,7 +178,7 @@ watch(() => editor.state.content, (newValue) => {
168
178
  v-if="editor.state.isSplitView"
169
179
  v-model="editor.state.content"
170
180
  language="html"
171
- class="code-editor"
181
+ :height="editor.state.isFullscreen ? 'calc(100vh - 4rem)' : '250px'"
172
182
  @update:modelValue="editor.updateState.content('html')"
173
183
  />
174
184
  </div>
@@ -196,12 +206,6 @@ watch(() => editor.state.content, (newValue) => {
196
206
  .content-area li{
197
207
  line-height: 1.65;
198
208
  }
199
-
200
- .code-editor {
201
- flex: 1;
202
- min-height: 240px !important;
203
- height: 100%;
204
- }
205
209
  </style>
206
210
 
207
211
  <style scoped>
@@ -213,7 +217,7 @@ watch(() => editor.state.content, (newValue) => {
213
217
 
214
218
  .editor-container {
215
219
  display: flex;
216
- gap: 1rem;
220
+ gap: 0.5rem;
217
221
  }
218
222
 
219
223
  .content-area,
@@ -274,9 +278,6 @@ watch(() => editor.state.content, (newValue) => {
274
278
  height: 100%;
275
279
  overflow-y: auto;
276
280
  }
277
- .fullscreen-mode .code-editor{
278
- height: 100% !important;
279
- }
280
281
 
281
282
  .debug-controls {
282
283
  display: flex;
@@ -124,26 +124,51 @@ export function sleep(ms: number = 100) {
124
124
  return new Promise(resolve => setTimeout(resolve, ms))
125
125
  }
126
126
 
127
- export function appendScript(src: string, options?: { id?: string }): Promise<void> {
128
- return new Promise((resolve, reject) => {
129
- if (options?.id) {
130
- if (document.getElementById(options.id)) {
131
- resolve()
132
- return
133
- }
134
- } else if (document.querySelector(`script[src="${src}"]`)) {
135
- resolve()
136
- return
137
- }
127
+ // Keep track of loading scripts
128
+ const scriptsLoading = new Map<string, Promise<void>>()
129
+
130
+ export async function appendScript(src: string, options?: { id?: string }): Promise<void> {
131
+ const scriptId = options?.id || src
132
+ await sleep(1)
133
+ // If this script is already loading, return the existing promise
134
+ if (scriptsLoading.has(scriptId)) {
135
+ return scriptsLoading.get(scriptId)!
136
+ }
137
+
138
+ // Check if script is already in the document
139
+ if (options?.id && document.getElementById(options.id)) {
140
+ return Promise.resolve()
141
+ } else if (document.querySelector(`script[src="${src}"]`)) {
142
+ return Promise.resolve()
143
+ }
144
+
145
+ // Create a new loading promise for this script
146
+ const loadingPromise = new Promise<void>((resolve, reject) => {
138
147
  const script = document.createElement('script')
139
148
  script.src = src
140
149
  if (options?.id) {
141
150
  script.id = options.id
142
151
  }
143
- script.onload = () => { resolve() }
144
- script.onerror = reject
152
+
153
+ script.onload = () => {
154
+ resolve()
155
+ // Remove from loading scripts map when done
156
+ scriptsLoading.delete(scriptId)
157
+ }
158
+
159
+ script.onerror = (err) => {
160
+ reject(err)
161
+ // Remove from loading scripts map on error
162
+ scriptsLoading.delete(scriptId)
163
+ }
164
+
145
165
  document.head.append(script)
146
166
  })
167
+
168
+ // Store the loading promise for this script
169
+ scriptsLoading.set(scriptId, loadingPromise)
170
+
171
+ return loadingPromise
147
172
  }
148
173
 
149
174
  export function appendStyle(src: string): Promise<void> {
@@ -1,23 +0,0 @@
1
- export interface TimeUnit {
2
- singular: string;
3
- plural: string;
4
- }
5
- export type TranslationValue = string | TimeUnit;
6
- export interface LanguageTranslations {
7
- [key: string]: TranslationValue;
8
- }
9
- export type AvailableTimeLanguages = 'en' | 'es' | 'fr' | 'he';
10
- export type DayFormatTypes = 'DD' | 'DDD' | 'DDDD';
11
- export type MonthFormatTypes = 'MM' | 'MMM' | 'MMMM';
12
- export type YearFormatTypes = 'YY' | 'YYYY';
13
- export type HourFormatTypes = 'HH';
14
- export type MinuteFormatTypes = 'mm';
15
- export type SecondFormatTypes = 'ss';
16
- export type MillisecondFormatTypes = 'sss';
17
- export type AmPmFormatTypes = 'AmPm';
18
- export type DateFormatSeparatorTypes = '/' | '-' | ' ' | ':' | '.';
19
- export type CommonDateFormats = `${DayFormatTypes}${DateFormatSeparatorTypes}${MonthFormatTypes}${DateFormatSeparatorTypes}${YearFormatTypes}` | 'DD.MM.YY' | 'DD.MM.YYYY' | 'DD/MM/YY' | 'DD/MM/YYYY' | 'MM.DD.YY' | 'MM.DD.YYYY' | 'MM/DD/YY' | 'MM/DD/YYYY' | 'YYYY-MM-DD' | 'YY-MM-DD' | 'DD MMM YYYY' | 'DD MMMM YYYY' | 'DDD, DD MMM' | 'DDDD, DD MMMM' | 'MMM DD' | 'MMMM DD';
20
- export type CommonTimeFormats = 'HH:mm' | 'HH:mm:ss' | 'HH:mm:ss:sss' | 'HH:MM' | 'HH:mm AmPm';
21
- export type CommonDateTimeFormats = `${CommonDateFormats} ${CommonTimeFormats}` | `${CommonTimeFormats}, ${CommonDateFormats}` | 'YYYY-MM-DD HH:MM';
22
- export type DateTimeAcceptedFormats = CommonDateFormats | CommonTimeFormats | CommonDateTimeFormats;
23
- //# sourceMappingURL=timeago.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"timeago.d.ts","sourceRoot":"","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