@airalogy/aimd-recorder 1.24.3 → 1.24.5
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/{AimdCodeField-6Qe-i2Fr.js → AimdCodeField-lUbFTqiD.js} +1 -1
- package/dist/{AimdDnaSequenceField-UkWAd5eE.js → AimdDnaSequenceField-CxFtD5Au.js} +2 -2
- package/dist/{AimdEditor.vue_vue_type_style_index_0_lang-BzzZoCeB.js → AimdEditor.vue_vue_type_style_index_0_lang-B0n0inzY.js} +1 -1
- package/dist/{AimdEntityRefField-DSaP0MiW.js → AimdEntityRefField-DCE79vca.js} +1 -1
- package/dist/{AimdMarkdownField-1QfCkIo7.js → AimdMarkdownField-Du0Fh5sG.js} +4 -4
- package/dist/{AimdMarkdownNoteField-DI9CGLRp.js → AimdMarkdownNoteField-YnyNmBvM.js} +3 -3
- package/dist/AimdRequiredMarker.vue_vue_type_script_setup_true_lang-B5qDiOZn.js +25 -0
- package/dist/aimd-recorder.css +1 -1
- package/dist/{arc-DsbVIrtD.js → arc-B0vwJ3nm.js} +1 -1
- package/dist/{architectureDiagram-3BPJPVTR-BoKfuFBs.js → architectureDiagram-3BPJPVTR-B5niz6cr.js} +2 -2
- package/dist/{blockDiagram-GPEHLZMM-CVI9ZAHu.js → blockDiagram-GPEHLZMM-Qtk9HFm8.js} +4 -4
- package/dist/{c4Diagram-AAUBKEIU-DZjOGfIh.js → c4Diagram-AAUBKEIU-DfTlAW2e.js} +2 -2
- package/dist/{channel-ClyYV6L9.js → channel-CTIJccfL.js} +1 -1
- package/dist/{chunk-2J33WTMH-DAiwEd4z.js → chunk-2J33WTMH-9xMy_Pgx.js} +1 -1
- package/dist/{chunk-4BX2VUAB-C86LRjbo.js → chunk-4BX2VUAB-BYosfXC9.js} +1 -1
- package/dist/{chunk-55IACEB6-B240gM_h.js → chunk-55IACEB6-B8fHTImy.js} +1 -1
- package/dist/{chunk-727SXJPM-DLSdClpw.js → chunk-727SXJPM-C83DIicG.js} +5 -5
- package/dist/{chunk-AQP2D5EJ-CrvCTB0u.js → chunk-AQP2D5EJ-C-IOiRzH.js} +3 -3
- package/dist/{chunk-FMBD7UC4-CK8Xlkyf.js → chunk-FMBD7UC4-BtkEX_DM.js} +1 -1
- package/dist/{chunk-ND2GUHAM-BiTVkaJ4.js → chunk-ND2GUHAM-DIB3ib7j.js} +1 -1
- package/dist/{chunk-QZHKN3VN-DfLR8ET3.js → chunk-QZHKN3VN-BRsoqg2B.js} +1 -1
- package/dist/{classDiagram-4FO5ZUOK-CdGgcwcI.js → classDiagram-4FO5ZUOK-D39GKFwR.js} +2 -2
- package/dist/{classDiagram-v2-Q7XG4LA2-CdGgcwcI.js → classDiagram-v2-Q7XG4LA2-D39GKFwR.js} +2 -2
- package/dist/components.js +570 -569
- package/dist/composables.js +2 -2
- package/dist/{cose-bilkent-S5V4N54A-DNovPAAV.js → cose-bilkent-S5V4N54A-CyRaJD1S.js} +1 -1
- package/dist/{dagre-BM42HDAG-B7Y59pTv.js → dagre-BM42HDAG-K85xJEFU.js} +3 -3
- package/dist/{diagram-2AECGRRQ-DedulIP4.js → diagram-2AECGRRQ-DET7fuM5.js} +2 -2
- package/dist/{diagram-5GNKFQAL-CyLxoNz3.js → diagram-5GNKFQAL-Dlba-FRw.js} +3 -3
- package/dist/{diagram-KO2AKTUF-C-cOuKaw.js → diagram-KO2AKTUF-J4PMcx3F.js} +2 -2
- package/dist/{diagram-LMA3HP47-Bkrl6O9n.js → diagram-LMA3HP47-ldR5Az83.js} +2 -2
- package/dist/{diagram-OG6HWLK6-BFgGWMrC.js → diagram-OG6HWLK6-UM1_l5na.js} +3 -3
- package/dist/{erDiagram-TEJ5UH35-CMkLSr99.js → erDiagram-TEJ5UH35-eGmNSbi1.js} +4 -4
- package/dist/{flowDiagram-I6XJVG4X-aBHYqu-v.js → flowDiagram-I6XJVG4X-rHTJn3LZ.js} +6 -6
- package/dist/{ganttDiagram-6RSMTGT7-CPEIeMYJ.js → ganttDiagram-6RSMTGT7-DKmi_hWM.js} +2 -2
- package/dist/{gitGraphDiagram-PVQCEYII-7xsKXhbX.js → gitGraphDiagram-PVQCEYII-DpQ1cu5h.js} +3 -3
- package/dist/{graph-C_zDc2Lu.js → graph-CSRKgcbg.js} +1 -1
- package/dist/index.js +14 -12
- package/dist/{infoDiagram-5YYISTIA-fqTV1DiG.js → infoDiagram-5YYISTIA-v8jIxUL5.js} +1 -1
- package/dist/{ishikawaDiagram-YF4QCWOH-oFqWJGC1.js → ishikawaDiagram-YF4QCWOH-BaV5bCe8.js} +1 -1
- package/dist/{journeyDiagram-JHISSGLW-DXKZrVVD.js → journeyDiagram-JHISSGLW-DeU65SpU.js} +4 -4
- package/dist/{kanban-definition-UN3LZRKU-CyETGwWQ.js → kanban-definition-UN3LZRKU-TGHAcp6_.js} +2 -2
- package/dist/{layout-CJbxE-hP.js → layout-D_sj0Eed.js} +2 -2
- package/dist/{linear-CA6cJfSx.js → linear-TldV7C5w.js} +1 -1
- package/dist/{mermaid.core-BfkFhA7S.js → mermaid.core-CRSTqrrD.js} +34 -34
- package/dist/{mindmap-definition-RKZ34NQL-K9_vO_sM.js → mindmap-definition-RKZ34NQL-CejyEBat.js} +3 -3
- package/dist/{pieDiagram-4H26LBE5-7MAWO90T.js → pieDiagram-4H26LBE5-CWLZWcAW.js} +3 -3
- package/dist/{quadrantDiagram-W4KKPZXB-eKvwOhuh.js → quadrantDiagram-W4KKPZXB-CYidUieH.js} +2 -2
- package/dist/record.js +2 -2
- package/dist/{requirementDiagram-4Y6WPE33-BdTNg93D.js → requirementDiagram-4Y6WPE33-Cw4ko-tB.js} +3 -3
- package/dist/{sankeyDiagram-5OEKKPKP-Co6Zc9b1.js → sankeyDiagram-5OEKKPKP-BnX4Evuh.js} +1 -1
- package/dist/{sequenceDiagram-3UESZ5HK-Aac-pALW.js → sequenceDiagram-3UESZ5HK-BiGVMmS5.js} +3 -3
- package/dist/{stateDiagram-AJRCARHV-CKTvUK5C.js → stateDiagram-AJRCARHV-DIaBI1Uq.js} +4 -4
- package/dist/{stateDiagram-v2-BHNVJYJU-Dn0HRX6t.js → stateDiagram-v2-BHNVJYJU-BgfV-ldT.js} +2 -2
- package/dist/{timeline-definition-PNZ67QCA-4kyjawEk.js → timeline-definition-PNZ67QCA-C0_5OwxD.js} +2 -2
- package/dist/{useFieldRendering-DXdYwpSA.js → useFieldRendering-B2iMfsEA.js} +1 -1
- package/dist/{useVarHelpers-sM7Fe3SM.js → useVarHelpers-CSogsd1T.js} +121 -116
- package/dist/{validation-D8cXKg1z.js → validation-BYjlufCM.js} +1 -1
- package/dist/{vennDiagram-CIIHVFJN-DwkHwkFa.js → vennDiagram-CIIHVFJN-_ktbUOEm.js} +1 -1
- package/dist/{wardleyDiagram-YWT4CUSO-BPWdxrxm.js → wardleyDiagram-YWT4CUSO-iwftOr4-.js} +2 -2
- package/dist/{xychartDiagram-2RQKCTM6-DJVYSAwS.js → xychartDiagram-2RQKCTM6-C_h9QW07.js} +2 -2
- package/package.json +1 -1
- package/src/__tests__/required-marker.test.ts +27 -0
- package/src/__tests__/var-field-render.test.ts +48 -0
- package/src/components/AimdRequiredMarker.vue +1 -0
- package/src/components/AimdVarField.vue +2 -1
- package/src/components/index.ts +2 -0
- package/src/composables/__tests__/useVarHelpers.test.ts +47 -0
- package/src/composables/useVarHelpers.ts +9 -1
- package/src/index.ts +8 -1
- package/src/styles/recorder.css +8 -4
- package/dist/AimdRequiredMarker.vue_vue_type_script_setup_true_lang-oAsIq2Q_.js +0 -24
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { b4 as ga,
|
|
1
|
+
import { b4 as ga, bg as _a } from "./useVarHelpers-CSogsd1T.js";
|
|
2
2
|
import { g as Gn } from "./_commonjsHelpers-ByX85dGu.js";
|
|
3
3
|
var Ve = { exports: {} }, Wt = {}, ve = {}, we = {}, Bt = {}, Zt = {}, Yt = {}, fr;
|
|
4
4
|
function Dt() {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { aU as Gt, s as Wt, g as Kt, t as Ht, q as Yt, a as Xt, b as Zt, _ as w, F as wt, L as Jt, d as ot, al as Qt, ac as $t, ad as te, ae as ee, e as ne, A as se, H as ie, I as oe } from "./mermaid.core-
|
|
1
|
+
import { aU as Gt, s as Wt, g as Kt, t as Ht, q as Yt, a as Xt, b as Zt, _ as w, F as wt, L as Jt, d as ot, al as Qt, ac as $t, ad as te, ae as ee, e as ne, A as se, H as ie, I as oe } from "./mermaid.core-CRSTqrrD.js";
|
|
2
2
|
const kt = (t, n) => Gt(t, "a", -n), _t = 1e-10;
|
|
3
3
|
function st(t, n) {
|
|
4
4
|
const s = ae(t), e = s.filter((c) => re(c, t));
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { s as Mt, g as Nt, t as Lt, q as zt, a as Tt, b as At, _ as u, a1 as Xt, F as Et, H as J, l as Q, L as Yt, e as It, A as Ft, c as V } from "./mermaid.core-
|
|
2
|
-
import { p as Bt } from "./chunk-4BX2VUAB-
|
|
1
|
+
import { s as Mt, g as Nt, t as Lt, q as zt, a as Tt, b as At, _ as u, a1 as Xt, F as Et, H as J, l as Q, L as Yt, e as It, A as Ft, c as V } from "./mermaid.core-CRSTqrrD.js";
|
|
2
|
+
import { p as Bt } from "./chunk-4BX2VUAB-BYosfXC9.js";
|
|
3
3
|
import { p as Rt } from "./wardley-L42UT6IY-D7b2ujEZ.js";
|
|
4
4
|
var G = /* @__PURE__ */ u((o, r) => {
|
|
5
5
|
const e = o <= 1 ? o * 100 : o;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { s as gi, g as xi, t as Xt, q as di, a as fi, b as pi, _ as a, l as Yt, L as mi, e as yi, A as bi, F as _t, i as Ai, H as Nt, I as wi, a1 as Ci, am as Si, a9 as Wt } from "./mermaid.core-
|
|
1
|
+
import { s as gi, g as xi, t as Xt, q as di, a as fi, b as pi, _ as a, l as Yt, L as mi, e as yi, A as bi, F as _t, i as Ai, H as Nt, I as wi, a1 as Ci, am as Si, a9 as Wt } from "./mermaid.core-CRSTqrrD.js";
|
|
2
2
|
import { i as _i } from "./init-DjUOC4st.js";
|
|
3
3
|
import { o as ki } from "./ordinal-B6-f3MAq.js";
|
|
4
|
-
import { l as zt } from "./linear-
|
|
4
|
+
import { l as zt } from "./linear-TldV7C5w.js";
|
|
5
5
|
function Ri(e, t, i) {
|
|
6
6
|
e = +e, t = +t, i = (n = arguments.length) < 2 ? (t = e, e = 0, 1) : n < 3 ? 1 : +i;
|
|
7
7
|
for (var s = -1, n = Math.max(0, Math.ceil((t - e) / i)) | 0, o = new Array(n); ++s < n; )
|
package/package.json
CHANGED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { mount } from "@vue/test-utils"
|
|
2
|
+
import { readFileSync } from "node:fs"
|
|
3
|
+
import { dirname, resolve } from "node:path"
|
|
4
|
+
import { fileURLToPath } from "node:url"
|
|
5
|
+
import { describe, expect, it } from "vitest"
|
|
6
|
+
import AimdRequiredMarker from "../components/AimdRequiredMarker.vue"
|
|
7
|
+
|
|
8
|
+
const __dirname = dirname(fileURLToPath(import.meta.url))
|
|
9
|
+
const recorderStyles = readFileSync(resolve(__dirname, "../styles/recorder.css"), "utf8")
|
|
10
|
+
|
|
11
|
+
describe("AimdRequiredMarker", () => {
|
|
12
|
+
it("renders a visible and accessible required indicator", () => {
|
|
13
|
+
const wrapper = mount(AimdRequiredMarker, {
|
|
14
|
+
props: { label: "Required" },
|
|
15
|
+
})
|
|
16
|
+
|
|
17
|
+
const marker = wrapper.get("[data-aimd-required-marker='true']")
|
|
18
|
+
expect(marker.text()).toBe("*")
|
|
19
|
+
expect(marker.attributes("role")).toBe("img")
|
|
20
|
+
expect(marker.attributes("aria-label")).toBe("Required")
|
|
21
|
+
expect(marker.attributes("title")).toBe("Required")
|
|
22
|
+
})
|
|
23
|
+
|
|
24
|
+
it("reserves space on both sides so host containers do not clip the indicator", () => {
|
|
25
|
+
expect(recorderStyles).toMatch(/\.aimd-field__required-marker \{[\s\S]*?margin-inline-start: 0\.3rem;[\s\S]*?margin-inline-end: 0\.35rem;/)
|
|
26
|
+
})
|
|
27
|
+
})
|
|
@@ -55,6 +55,54 @@ describe('AimdVarField render behavior', () => {
|
|
|
55
55
|
expect(source).toMatch(/control\.setCustomValidity\(violation \?\? ""\)/)
|
|
56
56
|
})
|
|
57
57
|
|
|
58
|
+
it.each([
|
|
59
|
+
'int | None',
|
|
60
|
+
'None | integer',
|
|
61
|
+
'Optional[int]',
|
|
62
|
+
'typing.Optional[integer]',
|
|
63
|
+
])('renders nullable integer type %s with the native integer stepper', async (type) => {
|
|
64
|
+
const node: AimdVarNode = {
|
|
65
|
+
type: 'aimd',
|
|
66
|
+
fieldType: 'var',
|
|
67
|
+
scope: 'var',
|
|
68
|
+
id: 'nullable_count',
|
|
69
|
+
raw: '{{var|nullable_count}}',
|
|
70
|
+
definition: {
|
|
71
|
+
id: 'nullable_count',
|
|
72
|
+
type,
|
|
73
|
+
},
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
const wrapper = mount(AimdVarField, {
|
|
77
|
+
props: {
|
|
78
|
+
node,
|
|
79
|
+
disabled: false,
|
|
80
|
+
extraClasses: [],
|
|
81
|
+
messages: createAimdRecorderMessages('en-US'),
|
|
82
|
+
displayValue: '',
|
|
83
|
+
inputKind: 'number',
|
|
84
|
+
initialized: true,
|
|
85
|
+
},
|
|
86
|
+
})
|
|
87
|
+
|
|
88
|
+
const input = wrapper.find<HTMLInputElement>('input[data-rec-focus-key="var:nullable_count"]')
|
|
89
|
+
expect(input.attributes('type')).toBe('number')
|
|
90
|
+
expect(input.attributes('inputmode')).toBe('numeric')
|
|
91
|
+
expect(input.attributes('step')).toBe('1')
|
|
92
|
+
|
|
93
|
+
await input.setValue('2')
|
|
94
|
+
await input.setValue('')
|
|
95
|
+
|
|
96
|
+
const changes = wrapper.emitted('change') ?? []
|
|
97
|
+
expect(changes[changes.length - 1]?.[0]).toMatchObject({
|
|
98
|
+
id: 'nullable_count',
|
|
99
|
+
value: null,
|
|
100
|
+
type,
|
|
101
|
+
inputKind: 'number',
|
|
102
|
+
})
|
|
103
|
+
wrapper.unmount()
|
|
104
|
+
})
|
|
105
|
+
|
|
58
106
|
it('renders code-like vars with the dedicated code editor field', () => {
|
|
59
107
|
expect(source).toMatch(/const AimdCodeField = defineAsyncComponent\(\(\) => import\("\.\/AimdCodeField\.vue"\)\)/)
|
|
60
108
|
expect(source).toMatch(/if \(inputKind === "code"\)/)
|
|
@@ -39,6 +39,7 @@ import {
|
|
|
39
39
|
getEntityRefTypeConfig,
|
|
40
40
|
getVarEnumSelectValue,
|
|
41
41
|
getVarEnumValueFromSelectValue,
|
|
42
|
+
isIntegerVarType,
|
|
42
43
|
isNullableVarType,
|
|
43
44
|
normalizeScalarListInputItems,
|
|
44
45
|
type NumericInputAttributes,
|
|
@@ -652,7 +653,7 @@ export default defineComponent({
|
|
|
652
653
|
const type = node.definition?.type || "str"
|
|
653
654
|
const normalizedType = normalizeVarTypeName(type)
|
|
654
655
|
const inputKind = props.inputKind
|
|
655
|
-
const isIntegerInput =
|
|
656
|
+
const isIntegerInput = isIntegerVarType(type)
|
|
656
657
|
const usesDecimalTextInput = inputKind === "number" && !isIntegerInput
|
|
657
658
|
const meta = props.fieldMeta
|
|
658
659
|
const disabled = props.disabled
|
package/src/components/index.ts
CHANGED
|
@@ -12,6 +12,7 @@ import AimdCollectorField from "./AimdCollectorField.vue"
|
|
|
12
12
|
import AimdRecorder from "./AimdRecorder.vue"
|
|
13
13
|
import AimdRecorderEditor from "./AimdRecorderEditor.vue"
|
|
14
14
|
import AimdQuizRecorder from "./AimdQuizRecorder.vue"
|
|
15
|
+
import AimdRequiredMarker from "./AimdRequiredMarker.vue"
|
|
15
16
|
|
|
16
17
|
const AimdDnaSequenceField = defineAsyncComponent(() => import("./AimdDnaSequenceField.vue"))
|
|
17
18
|
const AimdMarkdownField = defineAsyncComponent(() => import("./AimdMarkdownField.vue"))
|
|
@@ -23,6 +24,7 @@ export {
|
|
|
23
24
|
AimdRecorder,
|
|
24
25
|
AimdRecorderEditor,
|
|
25
26
|
AimdQuizRecorder,
|
|
27
|
+
AimdRequiredMarker,
|
|
26
28
|
AimdEntityRefField,
|
|
27
29
|
AimdDnaSequenceField,
|
|
28
30
|
AimdMarkdownField,
|
|
@@ -7,6 +7,7 @@ import {
|
|
|
7
7
|
getScalarListInputItems,
|
|
8
8
|
getScalarListItemType,
|
|
9
9
|
getEntityRefTypeConfig,
|
|
10
|
+
isIntegerVarType,
|
|
10
11
|
isNullableVarType,
|
|
11
12
|
isEntityRefVarType,
|
|
12
13
|
isScalarListVarType,
|
|
@@ -275,6 +276,15 @@ describe('file-like var helpers', () => {
|
|
|
275
276
|
// ---------------------------------------------------------------------------
|
|
276
277
|
|
|
277
278
|
describe('numeric field constraints', () => {
|
|
279
|
+
it('recognizes nullable integer annotations as integer types', () => {
|
|
280
|
+
expect(isIntegerVarType('int')).toBe(true)
|
|
281
|
+
expect(isIntegerVarType('int | None')).toBe(true)
|
|
282
|
+
expect(isIntegerVarType('None | integer')).toBe(true)
|
|
283
|
+
expect(isIntegerVarType('Optional[int]')).toBe(true)
|
|
284
|
+
expect(isIntegerVarType('typing.Optional[integer]')).toBe(true)
|
|
285
|
+
expect(isIntegerVarType('float | None')).toBe(false)
|
|
286
|
+
})
|
|
287
|
+
|
|
278
288
|
it('reads Pydantic-style numeric constraints only for numeric var types', () => {
|
|
279
289
|
expect(getNumericFieldConstraints('float', { gt: 0, le: 100, multiple_of: 0.5 })).toEqual({
|
|
280
290
|
gt: 0,
|
|
@@ -867,6 +877,43 @@ describe('measureVarLabelWidth', () => {
|
|
|
867
877
|
|
|
868
878
|
expect(measureVarLabelWidth(wrapper)).toBeGreaterThan(220)
|
|
869
879
|
})
|
|
880
|
+
|
|
881
|
+
it('reserves label width for required markers', () => {
|
|
882
|
+
vi.spyOn(HTMLCanvasElement.prototype, 'getContext').mockImplementation(() => ({
|
|
883
|
+
measureText: (text: string) => ({ width: text.length * 8 }),
|
|
884
|
+
} as unknown as CanvasRenderingContext2D))
|
|
885
|
+
vi.spyOn(window, 'getComputedStyle').mockImplementation((element: Element) => {
|
|
886
|
+
const classList = (element as HTMLElement).classList
|
|
887
|
+
return {
|
|
888
|
+
fontSize: '14px',
|
|
889
|
+
fontFamily: 'sans-serif',
|
|
890
|
+
fontWeight: '500',
|
|
891
|
+
fontStyle: 'normal',
|
|
892
|
+
paddingLeft: classList.contains('aimd-field__name') ? '16px' : '0px',
|
|
893
|
+
paddingRight: classList.contains('aimd-field__scope--var') ? '14px' : '0px',
|
|
894
|
+
borderLeftWidth: '0px',
|
|
895
|
+
borderRightWidth: '0px',
|
|
896
|
+
marginLeft: classList.contains('aimd-field__required-marker') ? '4px' : '0px',
|
|
897
|
+
marginRight: classList.contains('aimd-field__required-marker') ? '5px' : '0px',
|
|
898
|
+
} as CSSStyleDeclaration
|
|
899
|
+
})
|
|
900
|
+
|
|
901
|
+
const optionalWrapper = document.createElement('span')
|
|
902
|
+
optionalWrapper.innerHTML = `
|
|
903
|
+
<span class="aimd-field__label">
|
|
904
|
+
<span class="aimd-field__scope aimd-field__scope--var">var</span>
|
|
905
|
+
<span class="aimd-field__name"><span class="aimd-field__title">age</span></span>
|
|
906
|
+
</span>
|
|
907
|
+
`
|
|
908
|
+
const requiredWrapper = optionalWrapper.cloneNode(true) as HTMLElement
|
|
909
|
+
requiredWrapper.querySelector('.aimd-field__name')?.insertAdjacentHTML(
|
|
910
|
+
'beforeend',
|
|
911
|
+
'<span class="aimd-field__required-marker">*</span>',
|
|
912
|
+
)
|
|
913
|
+
document.body.append(optionalWrapper, requiredWrapper)
|
|
914
|
+
|
|
915
|
+
expect(measureVarLabelWidth(requiredWrapper)).toBeGreaterThan(measureVarLabelWidth(optionalWrapper))
|
|
916
|
+
})
|
|
870
917
|
})
|
|
871
918
|
|
|
872
919
|
// ---------------------------------------------------------------------------
|
|
@@ -330,6 +330,11 @@ export function isNumericVarType(type: string | undefined): boolean {
|
|
|
330
330
|
return normalized === "float" || normalized === "int" || normalized === "integer" || normalized === "number"
|
|
331
331
|
}
|
|
332
332
|
|
|
333
|
+
export function isIntegerVarType(type: string | undefined): boolean {
|
|
334
|
+
const normalized = normalizeVarTypeName(unwrapOptionalTypeAnnotation(type))
|
|
335
|
+
return normalized === "int" || normalized === "integer"
|
|
336
|
+
}
|
|
337
|
+
|
|
333
338
|
function getScalarListItemTypeFromExpression(type: string | undefined): ScalarListItemType | undefined {
|
|
334
339
|
const normalized = canonicalizeTypeExpression(type).replace(/^typing\./, "")
|
|
335
340
|
if (normalized === "str" || normalized === "string" || normalized === "builtins.str") {
|
|
@@ -1137,8 +1142,11 @@ function getElementHorizontalSpace(element: HTMLElement): number {
|
|
|
1137
1142
|
function measureFieldNameWidth(name: HTMLElement): number {
|
|
1138
1143
|
const title = name.querySelector(".aimd-field__title") as HTMLElement | null
|
|
1139
1144
|
const key = name.querySelector(".aimd-field__key") as HTMLElement | null
|
|
1145
|
+
const requiredMarker = name.querySelector(".aimd-field__required-marker") as HTMLElement | null
|
|
1146
|
+
const titleRowWidth = (title ? measureLabelTokenWidth(title) : 0)
|
|
1147
|
+
+ (requiredMarker ? measureLabelTokenWidth(requiredMarker) : 0)
|
|
1140
1148
|
const visibleTokenWidth = Math.max(
|
|
1141
|
-
|
|
1149
|
+
titleRowWidth,
|
|
1142
1150
|
key ? measureLabelTokenWidth(key) : 0,
|
|
1143
1151
|
)
|
|
1144
1152
|
|
package/src/index.ts
CHANGED
|
@@ -10,7 +10,14 @@
|
|
|
10
10
|
import './styles/recorder.css'
|
|
11
11
|
import { AimdProtocolRecorder as DeprecatedAimdProtocolRecorder } from './components'
|
|
12
12
|
|
|
13
|
-
export {
|
|
13
|
+
export {
|
|
14
|
+
AimdAssignerGraph,
|
|
15
|
+
AimdCollectorField,
|
|
16
|
+
AimdRecorder,
|
|
17
|
+
AimdRecorderEditor,
|
|
18
|
+
AimdQuizRecorder,
|
|
19
|
+
AimdRequiredMarker,
|
|
20
|
+
} from './components'
|
|
14
21
|
export { AimdDnaSequenceField, AimdEntityRefField, AimdMarkdownField } from './components'
|
|
15
22
|
/**
|
|
16
23
|
* @deprecated Use `AimdRecorder` instead.
|
package/src/styles/recorder.css
CHANGED
|
@@ -128,11 +128,15 @@
|
|
|
128
128
|
display: inline-flex;
|
|
129
129
|
flex: 0 0 auto;
|
|
130
130
|
align-items: center;
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
131
|
+
justify-content: center;
|
|
132
|
+
min-width: 0.75rem;
|
|
133
|
+
margin-inline-start: 0.3rem;
|
|
134
|
+
margin-inline-end: 0.35rem;
|
|
135
|
+
color: var(--aimd-required-color, #d03050);
|
|
136
|
+
font-size: 1em;
|
|
137
|
+
font-weight: 800;
|
|
135
138
|
line-height: 1;
|
|
139
|
+
transform: translateY(-0.08em);
|
|
136
140
|
}
|
|
137
141
|
|
|
138
142
|
.aimd-field--no-style.aimd-field__label .aimd-field__name--with-metadata {
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { defineComponent as o, openBlock as n, createElementBlock as c } from "vue";
|
|
2
|
-
const _ = (e, a) => {
|
|
3
|
-
const t = e.__vccOpts || e;
|
|
4
|
-
for (const [r, l] of a)
|
|
5
|
-
t[r] = l;
|
|
6
|
-
return t;
|
|
7
|
-
}, i = ["aria-label", "title"], m = /* @__PURE__ */ o({
|
|
8
|
-
__name: "AimdRequiredMarker",
|
|
9
|
-
props: {
|
|
10
|
-
label: {}
|
|
11
|
-
},
|
|
12
|
-
setup(e) {
|
|
13
|
-
return (a, t) => (n(), c("span", {
|
|
14
|
-
class: "aimd-field__required-marker",
|
|
15
|
-
role: "img",
|
|
16
|
-
"aria-label": e.label,
|
|
17
|
-
title: e.label
|
|
18
|
-
}, "*", 8, i));
|
|
19
|
-
}
|
|
20
|
-
});
|
|
21
|
-
export {
|
|
22
|
-
m as _,
|
|
23
|
-
_ as a
|
|
24
|
-
};
|