@airalogy/aimd-recorder 1.17.0 → 1.18.0

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 (106) hide show
  1. package/README.md +11 -10
  2. package/README.zh-CN.md +11 -10
  3. package/dist/AimdCodeField-BQUuM-EF.js +182 -0
  4. package/dist/{AimdDnaSequenceField-D6ZgCDpp.js → AimdDnaSequenceField-KZU2Zj3E.js} +2 -2
  5. package/dist/{AimdEditor.vue_vue_type_style_index_0_lang-B5Tq4zPV.js → AimdEditor.vue_vue_type_style_index_0_lang-CzfYPp5r.js} +3922 -3829
  6. package/dist/AimdMarkdownField-t2d8uOeU.js +254 -0
  7. package/dist/AimdMarkdownNoteField-_h1oZSwH.js +259 -0
  8. package/dist/{_commonjsHelpers-CZXJ37nu.js → _commonjsHelpers-B5RozER-.js} +2 -2
  9. package/dist/aimd-recorder.css +1 -1
  10. package/dist/arc-DS_ocYoe.js +83 -0
  11. package/dist/architectureDiagram-3BPJPVTR-Dq2W8_tb.js +4692 -0
  12. package/dist/blockDiagram-GPEHLZMM-B4hnSAF_.js +2425 -0
  13. package/dist/c4Diagram-AAUBKEIU-CbffqNLY.js +1577 -0
  14. package/dist/channel-CtXnYrAk.js +5 -0
  15. package/dist/chunk-2J33WTMH-CROScrt5.js +19 -0
  16. package/dist/chunk-4BX2VUAB-DTmsQu5_.js +8 -0
  17. package/dist/chunk-55IACEB6-B5wDJzeX.js +8 -0
  18. package/dist/chunk-727SXJPM-CfyltY6o.js +1528 -0
  19. package/dist/chunk-AQP2D5EJ-B8274EYy.js +1387 -0
  20. package/dist/chunk-FMBD7UC4-CT_FK-SH.js +19 -0
  21. package/dist/chunk-ND2GUHAM-g9GulPi-.js +68 -0
  22. package/dist/chunk-QZHKN3VN-Di5HEktz.js +15 -0
  23. package/dist/classDiagram-4FO5ZUOK-BVUr246k.js +16 -0
  24. package/dist/classDiagram-v2-Q7XG4LA2-BVUr246k.js +16 -0
  25. package/dist/components.js +3279 -2216
  26. package/dist/composables.js +92 -68
  27. package/dist/cose-bilkent-S5V4N54A-GJ4IOO6v.js +2609 -0
  28. package/dist/cytoscape.esm-r59gEWFs.js +18710 -0
  29. package/dist/dagre-BM42HDAG-oL7Br44o.js +445 -0
  30. package/dist/defaultLocale-BgPVtth8.js +171 -0
  31. package/dist/diagram-2AECGRRQ-DtoCG_N4.js +217 -0
  32. package/dist/diagram-5GNKFQAL-f8QNdS7L.js +123 -0
  33. package/dist/diagram-KO2AKTUF-CsJOW_AX.js +461 -0
  34. package/dist/diagram-LMA3HP47-xmEKNZ7y.js +142 -0
  35. package/dist/diagram-OG6HWLK6-unpC7vo8.js +528 -0
  36. package/dist/erDiagram-TEJ5UH35-BGzFnCJD.js +899 -0
  37. package/dist/flowDiagram-I6XJVG4X-LBFhDnOs.js +1628 -0
  38. package/dist/ganttDiagram-6RSMTGT7-CFBc-jPD.js +2707 -0
  39. package/dist/gitGraphDiagram-PVQCEYII-BLduh-Rb.js +815 -0
  40. package/dist/graph-DdlKE625.js +1510 -0
  41. package/dist/index.js +104 -80
  42. package/dist/infoDiagram-5YYISTIA-CLQQI6zM.js +24 -0
  43. package/dist/init-DjUOC4st.js +16 -0
  44. package/dist/ishikawaDiagram-YF4QCWOH-CStdYBmW.js +621 -0
  45. package/dist/journeyDiagram-JHISSGLW-B6mRTzoE.js +834 -0
  46. package/dist/kanban-definition-UN3LZRKU-C-vnN5v4.js +724 -0
  47. package/dist/katex-DNob3HGn.js +11690 -0
  48. package/dist/layout-DDt0fz-M.js +1703 -0
  49. package/dist/linear-C-IAFdOt.js +259 -0
  50. package/dist/mermaid.core-CuZ3nINf.js +15940 -0
  51. package/dist/mindmap-definition-RKZ34NQL-TSZ1Vb3z.js +827 -0
  52. package/dist/ordinal-B6-f3MAq.js +61 -0
  53. package/dist/pieDiagram-4H26LBE5-DYok-1-k.js +163 -0
  54. package/dist/quadrantDiagram-W4KKPZXB-Cg856sbH.js +1024 -0
  55. package/dist/requirementDiagram-4Y6WPE33-BN9fGdlJ.js +882 -0
  56. package/dist/sankeyDiagram-5OEKKPKP-CDqTgonY.js +847 -0
  57. package/dist/sequenceDiagram-3UESZ5HK-Chjrc0-W.js +2891 -0
  58. package/dist/stateDiagram-AJRCARHV-DRyLHrdr.js +263 -0
  59. package/dist/stateDiagram-v2-BHNVJYJU-CZTIDHid.js +16 -0
  60. package/dist/timeline-definition-PNZ67QCA-Bc3D9AAG.js +1055 -0
  61. package/dist/{useFieldRendering-xLajJhyA.js → useCodeBlockRendering-qA6gj4vz.js} +3035 -2254
  62. package/dist/useMonacoAutoHeight-D4T-El3J.js +66 -0
  63. package/dist/vennDiagram-CIIHVFJN-CYAul48m.js +1557 -0
  64. package/dist/wardley-L42UT6IY-D7b2ujEZ.js +22512 -0
  65. package/dist/wardleyDiagram-YWT4CUSO-B7Tg0MG9.js +675 -0
  66. package/dist/xychartDiagram-2RQKCTM6-xWYVEqth.js +1342 -0
  67. package/package.json +9 -8
  68. package/src/__tests__/assigner-runner-dependent-data.test.ts +32 -0
  69. package/src/__tests__/markdown-field.test.ts +150 -1
  70. package/src/__tests__/markdown-note-field.test.ts +86 -3
  71. package/src/__tests__/recorder-assigner-control.test.ts +844 -0
  72. package/src/__tests__/recorder-editor.test.ts +17 -0
  73. package/src/__tests__/recorder-markdown-assigner-integration.test.ts +49 -0
  74. package/src/__tests__/step-field.test.ts +47 -1
  75. package/src/__tests__/type-plugins.test.ts +1 -0
  76. package/src/__tests__/var-field-render.test.ts +741 -1
  77. package/src/components/AimdCodeField.vue +24 -5
  78. package/src/components/AimdMarkdownField.vue +548 -11
  79. package/src/components/AimdMarkdownNoteField.vue +241 -30
  80. package/src/components/AimdRecorder.vue +1521 -95
  81. package/src/components/AimdRecorderEditor.vue +276 -8
  82. package/src/components/AimdRecorderWysiwygFieldHost.vue +6 -0
  83. package/src/components/AimdRecorderWysiwygSurface.vue +32 -0
  84. package/src/components/AimdStepCheckField.vue +82 -18
  85. package/src/components/AimdVarField.vue +694 -25
  86. package/src/components/AimdVarTableField.vue +283 -110
  87. package/src/components/icons/AimdAssignerCalculatorIcon.vue +18 -0
  88. package/src/components/icons/AimdAssignerCloudStatusIcon.vue +22 -0
  89. package/src/components/recorderMilkdownPlugin.ts +14 -0
  90. package/src/composables/__tests__/useRecordState.test.ts +86 -0
  91. package/src/composables/__tests__/useVarHelpers.test.ts +133 -0
  92. package/src/composables/index.ts +27 -1
  93. package/src/composables/useAssignerRunner.ts +376 -0
  94. package/src/composables/useCodeBlockRendering.ts +51 -0
  95. package/src/composables/useFieldRendering.ts +32 -4
  96. package/src/composables/useMonacoAutoHeight.ts +127 -0
  97. package/src/composables/useRecordState.ts +22 -3
  98. package/src/composables/useVarHelpers.ts +377 -9
  99. package/src/index.ts +13 -0
  100. package/src/locales.ts +45 -0
  101. package/src/styles/aimd.css +151 -1
  102. package/src/type-plugins.ts +7 -0
  103. package/src/types.ts +93 -2
  104. package/dist/AimdCodeField-DC3DPvgc.js +0 -172
  105. package/dist/AimdMarkdownField-BJ20QtO8.js +0 -67
  106. package/dist/AimdMarkdownNoteField-DwAQhoyk.js +0 -186
@@ -46,6 +46,135 @@
46
46
  font-weight: 500;
47
47
  }
48
48
 
49
+ .aimd-field__name--with-metadata {
50
+ display: inline-flex;
51
+ flex-direction: column;
52
+ align-items: flex-start;
53
+ gap: 1px;
54
+ line-height: 1.25;
55
+ }
56
+
57
+ .aimd-field__metadata-host {
58
+ position: relative;
59
+ cursor: help;
60
+ outline: none;
61
+ }
62
+
63
+ .aimd-field__metadata-host:hover,
64
+ .aimd-field__metadata-host:focus,
65
+ .aimd-field__metadata-host:focus-within {
66
+ z-index: 90;
67
+ }
68
+
69
+ .aimd-field__metadata-host:focus-visible {
70
+ border-radius: 4px;
71
+ box-shadow: 0 0 0 2px rgba(65, 129, 253, 0.24);
72
+ }
73
+
74
+ .aimd-field__metadata-host .aimd-field__title {
75
+ text-decoration-line: underline;
76
+ text-decoration-style: dotted;
77
+ text-decoration-color: rgba(15, 23, 42, 0.36);
78
+ text-underline-offset: 3px;
79
+ }
80
+
81
+ .aimd-field__title {
82
+ font-weight: inherit;
83
+ }
84
+
85
+ .aimd-field__key {
86
+ font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
87
+ font-size: 11px;
88
+ font-weight: 500;
89
+ line-height: 1.2;
90
+ color: rgba(15, 23, 42, 0.55);
91
+ }
92
+
93
+ .aimd-field__metadata-popover {
94
+ position: absolute;
95
+ z-index: 80;
96
+ inset-inline-start: 0;
97
+ top: calc(100% + 7px);
98
+ display: inline-flex;
99
+ flex-direction: column;
100
+ gap: 4px;
101
+ width: max-content;
102
+ min-width: 220px;
103
+ max-width: min(360px, 82vw);
104
+ padding: 8px 10px;
105
+ border-radius: 8px;
106
+ background: rgba(15, 23, 42, 0.96);
107
+ color: #f8fafc;
108
+ box-shadow: 0 12px 30px rgba(15, 23, 42, 0.28);
109
+ font-size: 12px;
110
+ font-weight: 500;
111
+ line-height: 1.45;
112
+ letter-spacing: 0;
113
+ text-align: left;
114
+ text-transform: none;
115
+ white-space: normal;
116
+ pointer-events: none;
117
+ opacity: 0;
118
+ visibility: hidden;
119
+ transform: translateY(-2px);
120
+ transition:
121
+ opacity 120ms ease,
122
+ transform 120ms ease,
123
+ visibility 120ms ease;
124
+ }
125
+
126
+ .aimd-field__metadata-popover::before {
127
+ content: "";
128
+ position: absolute;
129
+ inset-inline-start: 14px;
130
+ top: -5px;
131
+ width: 10px;
132
+ height: 10px;
133
+ background: rgba(15, 23, 42, 0.96);
134
+ transform: rotate(45deg);
135
+ }
136
+
137
+ .aimd-field__metadata-popover-line {
138
+ display: block;
139
+ color: inherit;
140
+ }
141
+
142
+ .aimd-field__metadata-examples {
143
+ display: flex;
144
+ flex-wrap: wrap;
145
+ align-items: center;
146
+ gap: 4px;
147
+ padding-top: 1px;
148
+ }
149
+
150
+ .aimd-field__metadata-examples-label {
151
+ color: rgba(226, 232, 240, 0.78);
152
+ }
153
+
154
+ .aimd-field__metadata-example {
155
+ display: inline-flex;
156
+ align-items: center;
157
+ max-width: 100%;
158
+ padding: 1px 6px;
159
+ border: 1px solid rgba(248, 250, 252, 0.18);
160
+ border-radius: 5px;
161
+ background: rgba(248, 250, 252, 0.1);
162
+ color: #f8fafc;
163
+ font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
164
+ font-size: 11px;
165
+ font-weight: 600;
166
+ line-height: 1.45;
167
+ overflow-wrap: anywhere;
168
+ }
169
+
170
+ .aimd-field__metadata-host:hover > .aimd-field__metadata-popover,
171
+ .aimd-field__metadata-host:focus > .aimd-field__metadata-popover,
172
+ .aimd-field__metadata-host:focus-within > .aimd-field__metadata-popover {
173
+ opacity: 1;
174
+ visibility: visible;
175
+ transform: translateY(0);
176
+ }
177
+
49
178
  .aimd-field--var .aimd-field__type {
50
179
  font-size: 12px;
51
180
  color: #7b1fa2;
@@ -92,7 +221,7 @@
92
221
  border-collapse: collapse;
93
222
  font-size: 12px;
94
223
  border-radius: 4px;
95
- overflow: hidden;
224
+ overflow: visible;
96
225
  }
97
226
 
98
227
  .aimd-field--var-table .aimd-field__table-preview th,
@@ -103,11 +232,19 @@
103
232
  }
104
233
 
105
234
  .aimd-field--var-table .aimd-field__table-preview th {
235
+ position: relative;
236
+ overflow: visible;
106
237
  background: #cfeed0;
107
238
  font-weight: 600;
108
239
  color: #2e7d32;
109
240
  }
110
241
 
242
+ .aimd-field--var-table .aimd-field__table-preview th:has(.aimd-field__metadata-host:hover),
243
+ .aimd-field--var-table .aimd-field__table-preview th:has(.aimd-field__metadata-host:focus),
244
+ .aimd-field--var-table .aimd-field__table-preview th:has(.aimd-field__metadata-host:focus-within) {
245
+ z-index: 95;
246
+ }
247
+
111
248
  .aimd-field--var-table .aimd-field__table-preview td {
112
249
  color: #666;
113
250
  font-style: italic;
@@ -508,6 +645,10 @@
508
645
  min-height: 28px;
509
646
  }
510
647
 
648
+ .aimd-field--no-style.aimd-field__label.aimd-field__label--has-metadata {
649
+ overflow: visible;
650
+ }
651
+
511
652
  /* Default scope color for edit mode labels (var type - blue, matches preview) */
512
653
  .aimd-field--no-style.aimd-field__label .aimd-field__scope {
513
654
  border-radius: 6px 0 0 0;
@@ -530,6 +671,15 @@
530
671
  align-items: center;
531
672
  }
532
673
 
674
+ .aimd-field--no-style.aimd-field__label .aimd-field__name--with-metadata {
675
+ align-items: flex-start;
676
+ justify-content: center;
677
+ gap: 2px;
678
+ min-width: 0;
679
+ padding-top: 5px;
680
+ padding-bottom: 5px;
681
+ }
682
+
533
683
  /* Edit mode label scope colors - step type (orange) */
534
684
  .aimd-field--no-style.aimd-field__label:has(.aimd-field__scope[class*="--step"]),
535
685
  .aimd-field--no-style.aimd-field__label:has(.aimd-field__scope[class*="--rns"]),
@@ -62,6 +62,7 @@ export const BUILT_IN_AIMD_TYPE_PLUGINS: AimdTypePlugin[] = [
62
62
  {
63
63
  type: 'AiralogyMarkdown',
64
64
  inputKind: 'textarea',
65
+ supportsInlineAssignerControl: true,
65
66
  renderField: ({
66
67
  node,
67
68
  value,
@@ -69,6 +70,9 @@ export const BUILT_IN_AIMD_TYPE_PLUGINS: AimdTypePlugin[] = [
69
70
  locale,
70
71
  messages,
71
72
  extraClasses,
73
+ assignerControl,
74
+ assignerStatus,
75
+ assignerError,
72
76
  emitChange,
73
77
  emitBlur,
74
78
  }) => h(AimdMarkdownField, {
@@ -78,6 +82,9 @@ export const BUILT_IN_AIMD_TYPE_PLUGINS: AimdTypePlugin[] = [
78
82
  disabled,
79
83
  locale,
80
84
  messages,
85
+ assignerControl,
86
+ assignerStatus,
87
+ assignerError,
81
88
  'onUpdate:modelValue': (nextValue: string) => emitChange(nextValue),
82
89
  onBlur: emitBlur,
83
90
  }),
package/src/types.ts CHANGED
@@ -59,10 +59,66 @@ export interface AimdProtocolRecordData {
59
59
  quiz: Record<string, unknown>
60
60
  }
61
61
 
62
- export type AimdVarInputKind = "text" | "number" | "checkbox" | "textarea" | "date" | "datetime" | "time" | "dna" | "code"
62
+ export interface AimdSelectedFileValue {
63
+ format: "airalogy_selected_file_v1"
64
+ name: string
65
+ type: string
66
+ size: number
67
+ lastModified: number
68
+ }
69
+
70
+ export interface AimdResolvedFileInfo {
71
+ id?: string
72
+ name?: string
73
+ fileName?: string
74
+ file_name?: string
75
+ filename?: string
76
+ url?: string
77
+ src?: string
78
+ downloadUrl?: string
79
+ thumbnailUrl?: string
80
+ type?: string
81
+ contentType?: string
82
+ content_type?: string
83
+ mimeType?: string
84
+ size?: number
85
+ }
86
+
87
+ export interface AimdFileUploadContext {
88
+ type: string
89
+ normalizedType: string
90
+ fieldKey: string
91
+ node: AimdVarNode
92
+ fieldMeta?: AimdFieldMeta
93
+ accept?: string
94
+ }
95
+
96
+ export type AimdFileUploadHandler = (
97
+ file: File,
98
+ context: AimdFileUploadContext,
99
+ ) => unknown | Promise<unknown>
100
+
101
+ export interface AimdFileResolveContext {
102
+ type: string
103
+ normalizedType: string
104
+ fieldKey: string
105
+ node: AimdVarNode
106
+ fieldMeta?: AimdFieldMeta
107
+ kind: string
108
+ }
109
+
110
+ export type AimdFileInfoResolver = (
111
+ src: string,
112
+ context: AimdFileResolveContext,
113
+ ) => AimdResolvedFileInfo | string | null | undefined | Promise<AimdResolvedFileInfo | string | null | undefined>
114
+
115
+ export type AimdVarInputKind = "text" | "number" | "checkbox" | "textarea" | "date" | "datetime" | "time" | "dna" | "code" | "file"
63
116
  export type AimdStepDetailDisplay = "auto" | "always"
64
117
  export type AimdChoiceOptionExplanationMode = "hidden" | "selected" | "submitted" | "graded"
65
118
  export type AimdScaleGradeDisplayMode = "hidden" | "completed" | "submitted" | "graded"
119
+ export type AimdAssignerMode = "auto" | "auto_first" | "auto_force" | "manual" | "manual_readonly" | "auto_readonly"
120
+ export type AimdServerAssignerMap = Record<string, AimdAssignerDefinition | unknown>
121
+ export type AimdAssignerMap = AimdServerAssignerMap
66
122
 
67
123
  export function createEmptyProtocolRecordData(): AimdProtocolRecordData {
68
124
  return {
@@ -79,6 +135,9 @@ export function createEmptyProtocolRecordData(): AimdProtocolRecordData {
79
135
 
80
136
  /** Field metadata — app passes via prop to describe extra field info */
81
137
  export interface AimdFieldMeta {
138
+ title?: string // display title override
139
+ description?: string // helper text override
140
+ examples?: unknown[] // example values used for helper text and placeholders
82
141
  inputType?: string // override built-in input kind or a host-defined custom type mapping
83
142
  codeLanguage?: string // Monaco language id for code-like fields (e.g. "python", "json")
84
143
  required?: boolean
@@ -86,7 +145,8 @@ export interface AimdFieldMeta {
86
145
  enumOptions?: Array<{ label: string; value: unknown }>
87
146
  disabled?: boolean
88
147
  placeholder?: string
89
- assigner?: { mode: 'manual' | 'auto_first' | 'auto_force' }
148
+ accept?: string // native file input accept string for file-like vars
149
+ assigner?: { mode: AimdAssignerMode }
90
150
  }
91
151
 
92
152
  /** Field runtime state — app updates dynamically via prop */
@@ -97,6 +157,30 @@ export interface AimdFieldState {
97
157
  disabled?: boolean // dynamic disable
98
158
  }
99
159
 
160
+ export interface AimdAssignerDefinition {
161
+ mode?: string
162
+ dependent_fields?: unknown
163
+ [key: string]: unknown
164
+ }
165
+
166
+ export interface AimdServerAssignerRunnerRequest {
167
+ section: Exclude<AimdRecorderFieldType, "quiz">
168
+ fieldKey: string
169
+ assignedField: string
170
+ dependentData: Record<string, unknown>
171
+ record: AimdProtocolRecordData
172
+ assigner: AimdAssignerDefinition
173
+ signal?: AbortSignal
174
+ }
175
+
176
+ export type AimdAssignerRunnerRequest = AimdServerAssignerRunnerRequest
177
+
178
+ export type AimdServerAssignerRunner = (
179
+ request: AimdServerAssignerRunnerRequest,
180
+ ) => unknown | Promise<unknown>
181
+
182
+ export type AimdAssignerRunner = AimdServerAssignerRunner
183
+
100
184
  /** Field event payload */
101
185
  export interface FieldEventPayload {
102
186
  section: 'var' | 'step' | 'check' | 'quiz' | 'var_table'
@@ -153,6 +237,12 @@ export interface AimdTypePluginRenderContext extends AimdTypePluginValueContext
153
237
  extraClasses: string[]
154
238
  placeholder?: string
155
239
  fieldState?: AimdFieldState
240
+ assignerControl?: VNode
241
+ assignerStatus?: VNode
242
+ assignerError?: string
243
+ uploadFile?: AimdFileUploadHandler
244
+ resolveFile?: (src: string) => string | null
245
+ resolveFileInfo?: AimdFileInfoResolver
156
246
  emitChange: (value: unknown) => void
157
247
  emitBlur: () => void
158
248
  }
@@ -161,6 +251,7 @@ export interface AimdTypePlugin {
161
251
  type: string
162
252
  aliases?: string[]
163
253
  inputKind?: AimdVarInputKind
254
+ supportsInlineAssignerControl?: boolean
164
255
  getInitialValue?: (context: AimdTypePluginInitContext) => unknown
165
256
  normalizeValue?: (context: AimdTypePluginValueContext) => unknown
166
257
  getDisplayValue?: (context: AimdTypePluginValueContext) => string | number
@@ -1,172 +0,0 @@
1
- import { defineComponent as j, ref as d, onMounted as V, onBeforeUnmount as B, watch as v, openBlock as u, createElementBlock as c, normalizeClass as D, createElementVNode as _, Fragment as L, createCommentVNode as F } from "vue";
2
- import { _ as z } from "./_commonjsHelpers-CZXJ37nu.js";
3
- function $(n) {
4
- return new Worker(
5
- "/assets/editor.worker-CpuX8TSY.js",
6
- {
7
- name: n?.name
8
- }
9
- );
10
- }
11
- function x(n) {
12
- return new Worker(
13
- "/assets/css.worker-Dmf38jDD.js",
14
- {
15
- name: n?.name
16
- }
17
- );
18
- }
19
- function P(n) {
20
- return new Worker(
21
- "/assets/html.worker-DotaEs7v.js",
22
- {
23
- name: n?.name
24
- }
25
- );
26
- }
27
- function S(n) {
28
- return new Worker(
29
- "/assets/json.worker-B4VHhH6h.js",
30
- {
31
- name: n?.name
32
- }
33
- );
34
- }
35
- function T(n) {
36
- return new Worker(
37
- "/assets/ts.worker-sl17zBDo.js",
38
- {
39
- name: n?.name
40
- }
41
- );
42
- }
43
- const I = {
44
- css: () => import("./monaco.contribution-b5xkgQ-s.js"),
45
- scss: () => import("./monaco.contribution-b5xkgQ-s.js"),
46
- less: () => import("./monaco.contribution-b5xkgQ-s.js"),
47
- html: () => import("./monaco.contribution-C-bQhUTI.js"),
48
- javascript: () => import("./monaco.contribution-Col-f0XR.js"),
49
- typescript: () => import("./monaco.contribution-Col-f0XR.js"),
50
- json: () => import("./monaco.contribution-CCVvl3Jx.js"),
51
- ini: () => import("./ini.contribution-DyWtiacL.js"),
52
- markdown: () => import("./markdown.contribution-DYYk6zUU.js"),
53
- python: () => import("./python.contribution-CcKs2Ktm.js"),
54
- shell: () => import("./shell.contribution-B80NZ3iO.js"),
55
- sql: () => import("./sql.contribution-DQy36aE5.js"),
56
- xml: () => import("./xml.contribution-XMOaon8i.js"),
57
- yaml: () => import("./yaml.contribution-DRRVhJmJ.js")
58
- }, b = /* @__PURE__ */ new Map();
59
- function N() {
60
- typeof globalThis > "u" || typeof globalThis.MonacoEnvironment?.getWorker == "function" || (globalThis.MonacoEnvironment = {
61
- getWorker(a, o) {
62
- return o === "json" ? new S() : o === "css" || o === "scss" || o === "less" ? new x() : o === "html" || o === "handlebars" || o === "razor" ? new P() : o === "typescript" || o === "javascript" ? new T() : new $();
63
- }
64
- });
65
- }
66
- async function h(n) {
67
- const a = I[n];
68
- if (!a)
69
- return;
70
- const o = b.get(n);
71
- if (o)
72
- return o;
73
- const r = Promise.resolve(a()).then(() => {
74
- });
75
- return b.set(n, r), r;
76
- }
77
- const O = {
78
- key: 0,
79
- class: "aimd-code-field__fallback-shell"
80
- }, A = ["value", "disabled"], H = {
81
- key: 0,
82
- class: "aimd-code-field__loading"
83
- }, q = /* @__PURE__ */ j({
84
- __name: "AimdCodeField",
85
- props: {
86
- modelValue: { default: "" },
87
- language: {},
88
- disabled: { type: Boolean, default: !1 }
89
- },
90
- emits: ["update:modelValue", "blur"],
91
- setup(n, { emit: a }) {
92
- const o = n, r = a, m = d(null), f = d(!0), p = d(null), i = d(k(o.modelValue));
93
- let s = null, t = null, l = null, g = !1;
94
- function k(e) {
95
- return typeof e == "string" ? e : typeof e == "number" ? String(e) : "";
96
- }
97
- function y(e) {
98
- e !== i.value && (i.value = e, r("update:modelValue", e));
99
- }
100
- async function W(e) {
101
- !s || !l || (await h(e), s.editor.setModelLanguage(l, e));
102
- }
103
- async function C() {
104
- if (!(!m.value || t)) {
105
- f.value = !0, p.value = null;
106
- try {
107
- N(), s = await import("./editor.main-Du02abDl.js"), await h(o.language), t = s.editor.create(m.value, {
108
- value: i.value,
109
- language: o.language,
110
- theme: "vs",
111
- minimap: { enabled: !1 },
112
- scrollBeyondLastLine: !1,
113
- automaticLayout: !0,
114
- lineNumbers: "on",
115
- wordWrap: "on",
116
- tabSize: 2,
117
- padding: { top: 12, bottom: 12 },
118
- readOnly: o.disabled
119
- }), l = t.getModel(), t.onDidChangeModelContent(() => {
120
- g || !t || y(t.getValue());
121
- }), t.onDidBlurEditorWidget(() => {
122
- r("blur");
123
- });
124
- } catch (e) {
125
- p.value = e instanceof Error ? e.message : "Failed to load Monaco editor.";
126
- } finally {
127
- f.value = !1;
128
- }
129
- }
130
- }
131
- function E(e) {
132
- i.value = e, !(!t || e === t.getValue()) && (g = !0, t.setValue(e), g = !1);
133
- }
134
- function M(e) {
135
- y(e.target.value);
136
- }
137
- return V(() => {
138
- C();
139
- }), B(() => {
140
- t?.dispose(), l?.dispose();
141
- }), v(() => o.modelValue, (e) => {
142
- E(k(e));
143
- }), v(() => o.disabled, (e) => {
144
- t?.updateOptions({ readOnly: e });
145
- }), v(() => o.language, async (e) => {
146
- t && await W(e);
147
- }), (e, w) => (u(), c("div", {
148
- class: D(["aimd-code-field", { "aimd-code-field--disabled": n.disabled }])
149
- }, [
150
- p.value ? (u(), c("div", O, [
151
- _("textarea", {
152
- class: "aimd-code-field__fallback",
153
- value: i.value,
154
- disabled: n.disabled,
155
- spellcheck: "false",
156
- onInput: M,
157
- onBlur: w[0] || (w[0] = (U) => r("blur"))
158
- }, null, 40, A)
159
- ])) : (u(), c(L, { key: 1 }, [
160
- f.value ? (u(), c("div", H, "Loading code editor…")) : F("", !0),
161
- _("div", {
162
- ref_key: "editorContainer",
163
- ref: m,
164
- class: "aimd-code-field__editor"
165
- }, null, 512)
166
- ], 64))
167
- ], 2));
168
- }
169
- }), G = /* @__PURE__ */ z(q, [["__scopeId", "data-v-b814be63"]]);
170
- export {
171
- G as default
172
- };
@@ -1,67 +0,0 @@
1
- import { defineComponent as p, ref as m, watch as h, openBlock as v, createElementBlock as g, normalizeClass as k, createElementVNode as d, toDisplayString as c, unref as u, createVNode as w } from "vue";
2
- import { g as V, _ as y } from "./AimdEditor.vue_vue_type_style_index_0_lang-B5Tq4zPV.js";
3
- import "./useFieldRendering-xLajJhyA.js";
4
- import "@airalogy/aimd-core";
5
- import "@airalogy/aimd-renderer";
6
- import { _ as x } from "./_commonjsHelpers-CZXJ37nu.js";
7
- const R = { class: "aimd-field aimd-field--no-style aimd-field__label" }, B = { class: "aimd-field__scope aimd-field__scope--var" }, F = { class: "aimd-field__id" }, I = { class: "aimd-markdown-field__editor-shell" }, M = /* @__PURE__ */ p({
8
- __name: "AimdMarkdownField",
9
- props: {
10
- modelValue: { default: void 0 },
11
- varId: {},
12
- disabled: { type: Boolean, default: !1 },
13
- locale: { default: void 0 },
14
- messages: {}
15
- },
16
- emits: ["update:modelValue", "blur"],
17
- setup(a, { emit: f }) {
18
- const i = a, t = f;
19
- function n(e) {
20
- return typeof e == "string" ? e : e == null ? "" : String(e);
21
- }
22
- const r = m(null), o = m(n(i.modelValue));
23
- function b(e) {
24
- e !== o.value && (o.value = e, t("update:modelValue", e));
25
- }
26
- function _(e) {
27
- const l = r.value, s = e.relatedTarget;
28
- !l || s && l.contains(s) || t("blur");
29
- }
30
- return h(() => i.modelValue, (e) => {
31
- const l = n(e);
32
- l !== o.value && (o.value = l);
33
- }), (e, l) => (v(), g("div", {
34
- ref_key: "fieldRootRef",
35
- ref: r,
36
- class: k(["aimd-rec-inline aimd-rec-inline--var-stacked aimd-rec-inline--var-markdown aimd-field-wrapper aimd-markdown-field", { "aimd-markdown-field--disabled": a.disabled }]),
37
- onFocusout: _
38
- }, [
39
- d("span", R, [
40
- d("span", B, c(u(V)("var", a.messages)), 1),
41
- d("span", F, c(a.varId), 1)
42
- ]),
43
- d("div", I, [
44
- w(u(y), {
45
- class: "aimd-markdown-field__editor",
46
- "model-value": o.value,
47
- locale: a.locale,
48
- mode: "source",
49
- theme: "aimd-light",
50
- "show-top-bar": !0,
51
- "show-toolbar": !a.disabled,
52
- "show-md-toolbar": !0,
53
- "show-aimd-toolbar": !0,
54
- "enable-block-handle": !a.disabled,
55
- "keep-inactive-editors-mounted": !1,
56
- "min-height": 360,
57
- readonly: a.disabled,
58
- "monaco-options": { minimap: { enabled: !1 } },
59
- "onUpdate:modelValue": b
60
- }, null, 8, ["model-value", "locale", "show-toolbar", "enable-block-handle", "readonly"])
61
- ])
62
- ], 34));
63
- }
64
- }), E = /* @__PURE__ */ x(M, [["__scopeId", "data-v-7fbda7f4"]]);
65
- export {
66
- E as default
67
- };