@hatiolab/figure-model 0.1.21 → 0.1.22
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/blueprint-shape.d.ts.map +1 -1
- package/dist/blueprint-shape.js +4 -0
- package/dist/blueprint-shape.js.map +1 -1
- package/dist/blueprint.d.ts +7 -0
- package/dist/blueprint.d.ts.map +1 -1
- package/dist/blueprint.js +11 -40
- package/dist/blueprint.js.map +1 -1
- package/dist/grouping.d.ts +18 -0
- package/dist/grouping.d.ts.map +1 -1
- package/dist/grouping.js +14 -0
- package/dist/grouping.js.map +1 -1
- package/dist/origin.d.ts +29 -0
- package/dist/origin.d.ts.map +1 -0
- package/dist/origin.js +39 -0
- package/dist/origin.js.map +1 -0
- package/dist/sizing.d.ts.map +1 -1
- package/dist/sizing.js +4 -2
- package/dist/sizing.js.map +1 -1
- package/dist/types.d.ts +95 -36
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +55 -16
- package/dist/types.js.map +1 -1
- package/dist/validate.d.ts +0 -6
- package/dist/validate.d.ts.map +1 -1
- package/dist/validate.js +63 -11
- package/dist/validate.js.map +1 -1
- package/dist/visual-evidence.d.ts +1 -1
- package/dist/visual-evidence.d.ts.map +1 -1
- package/dist/visual-evidence.js +3 -1
- package/dist/visual-evidence.js.map +1 -1
- package/docs/format.md +142 -23
- package/docs/validation.md +72 -15
- package/package.json +2 -2
package/dist/types.d.ts
CHANGED
|
@@ -179,19 +179,6 @@ export type ChannelPath = (typeof CHANNEL_PATHS)[number];
|
|
|
179
179
|
/** 키프레임 사이를 어떻게 잇나. glTF 의 `CUBICSPLINE` 은 없다 — 접선을 손으로 적을 형식이 아니다. */
|
|
180
180
|
export declare const INTERPOLATIONS: readonly ["linear", "step"];
|
|
181
181
|
export type Interpolation = (typeof INTERPOLATIONS)[number];
|
|
182
|
-
/**
|
|
183
|
-
* **옛 자리다. 저작하지 않는다.**
|
|
184
|
-
*
|
|
185
|
-
* `drive: 'hold'` 가 「값이 자세를 만든다」를 말하던 칸이었다. 그 판단은 맞았는데 자리가
|
|
186
|
-
* 틀려서, 애니메이션 안에 숨은 채로 아무도 못 찾았다. 지금은 `FigureParameter` 가 제 칸으로
|
|
187
|
-
* 있고 `animations` 에는 시각이 흐르는 것만 남는다 — 그러니 여기서 말할 것이 없다
|
|
188
|
-
* (ADR-0051, `operato-twin/design/04-decisions.md`).
|
|
189
|
-
*
|
|
190
|
-
* 이름이 남아 있는 것은 **이미 저장된 것을 옮기기 위해서**다. `compile()` 이 옛 원본의
|
|
191
|
-
* `drive: 'hold'` 를 읽어 `parameters` 로 옮긴다. 옮기는 쪽이 사라지면 이 이름도 사라진다.
|
|
192
|
-
*/
|
|
193
|
-
export declare const CLIP_DRIVES: readonly ["loop", "hold"];
|
|
194
|
-
export type ClipDrive = (typeof CLIP_DRIVES)[number];
|
|
195
182
|
export declare const AXES: readonly ["x", "y", "z"];
|
|
196
183
|
export type Axis = (typeof AXES)[number];
|
|
197
184
|
/** 텍스트를 언제 보이나. 표현 수단(sprite·overlay)은 런타임이 고른다. */
|
|
@@ -233,8 +220,12 @@ export interface Point2 {
|
|
|
233
220
|
* ## 자리는 부품의 중심이다
|
|
234
221
|
*
|
|
235
222
|
* 여느 모델러와 같이 **원점은 부품의 중심**이고 `position` 은 그 원점의 자리다.
|
|
236
|
-
*
|
|
237
|
-
*
|
|
223
|
+
*
|
|
224
|
+
* The frame it is measured in has its origin at the bottom centre of the `base` box: `x` and `z` from
|
|
225
|
+
* the box centre, `y` up from the bottom face (source edition 2, ADR-0065). A part standing on the
|
|
226
|
+
* floor of the box has `position.y` equal to half its height, and changing `base.y` leaves every part's
|
|
227
|
+
* numbers where they were. Edition 1 measured `y` from the box centre as well; the compiled blueprint
|
|
228
|
+
* still does, and `origin.ts` is the one place a source is turned into that frame.
|
|
238
229
|
*
|
|
239
230
|
* 전에는 최소 모서리를 자리로 뒀다. 격자 스냅 때문이라고 적혀 있었는데, 모델러들은
|
|
240
231
|
* 모두 원점을 격자에 붙이고 크기는 따로 스냅한다. 우리만 다르게 둘 이유가 없다.
|
|
@@ -443,9 +434,9 @@ export interface AnimationClip {
|
|
|
443
434
|
*
|
|
444
435
|
* ## 두 층으로 되어 있다 — 아래는 표준, 위는 우리 것
|
|
445
436
|
*
|
|
446
|
-
* `clip`
|
|
447
|
-
*
|
|
448
|
-
*
|
|
437
|
+
* `clip` has the shape of a glTF animation: channels, keys and TRS paths. The one difference is that
|
|
438
|
+
* a key's `at` is a position on the 0..1 value span rather than a time, and the two convert without
|
|
439
|
+
* loss. See `ParameterClip`.
|
|
449
440
|
*
|
|
450
441
|
* 그 위에 얹는 `range` 가 우리 것이다 — 「이 곡선은 재생되는 것이 아니라 값이 몬다」와
|
|
451
442
|
* 「그 값은 mm 로 몇부터 몇까지다」. glTF 에 그것을 적을 자리가 없으므로, 못 받는 쪽은
|
|
@@ -458,15 +449,21 @@ export interface AnimationClip {
|
|
|
458
449
|
* 맵한다. 「길이값을 변수로 노출한다」는 그 API 에서 성립하고, 형식의 곡선은 표준 모양으로
|
|
459
450
|
* 남는다.
|
|
460
451
|
*
|
|
461
|
-
* ##
|
|
452
|
+
* ## The transition time is `clip.duration`
|
|
462
453
|
*
|
|
463
|
-
* `clip`
|
|
464
|
-
*
|
|
465
|
-
*
|
|
454
|
+
* `clip.duration` is the number of seconds a full move from 0 to 1 takes. When the value changes from
|
|
455
|
+
* v₁ to v₂ the pose moves in a straight line over `|v₂ − v₁| × duration`, which is the machine's
|
|
456
|
+
* speed. How fast a hoist lowers is a fact about the figure; when one installation differs, the
|
|
457
|
+
* instance overrides it.
|
|
466
458
|
*
|
|
467
459
|
* **ease 는 없다.** 기계는 연출하지 않는다.
|
|
468
460
|
*
|
|
469
|
-
*
|
|
461
|
+
* With no `duration`, or `0`, the move is instant: a new value goes straight to its pose.
|
|
462
|
+
*
|
|
463
|
+
* For a while the last key's time served as both the end of the value span and the transition time.
|
|
464
|
+
* A figure could then not declare several poses together with an instant move, since instant meant
|
|
465
|
+
* every key at 0, and legacy keys that happened to sit at 0 and 1 turned into a one-second move
|
|
466
|
+
* nobody chose. That is why the two facts have separate fields.
|
|
470
467
|
*/
|
|
471
468
|
export interface FigureParameter {
|
|
472
469
|
/** **저장되는 식별자다.** 인스턴스가 이 이름으로 값을 준다. */
|
|
@@ -497,10 +494,24 @@ export interface ParameterRange {
|
|
|
497
494
|
* 이름은 파라미터가 갖는다. 클립에 또 두면 둘이 갈릴 수 있고, 갈리면 인스턴스가 어느 이름으로
|
|
498
495
|
* 값을 주는지 알 수 없다.
|
|
499
496
|
*
|
|
500
|
-
*
|
|
501
|
-
*
|
|
497
|
+
* A key's `at` is a position on the value span, from `0` to `1`: `0` is the pose at `range.min` and
|
|
498
|
+
* `1` the pose at `range.max`. Keys need not cover the whole span; before the first key and after the
|
|
499
|
+
* last one the pose holds at the end key, the same clamping glTF applies outside a clip.
|
|
500
|
+
*
|
|
501
|
+
* Time lives in `duration`. Keys sit on the value axis and `duration` on the time axis, so the two
|
|
502
|
+
* cannot disagree.
|
|
503
|
+
*
|
|
504
|
+
* ## Converting to and from glTF loses nothing
|
|
505
|
+
*
|
|
506
|
+
* - Export: glTF key time = `at × (duration || 1)`. The curve goes out unchanged and its length is the
|
|
507
|
+
* transition time.
|
|
508
|
+
* - Import: divide every key time by the latest one to get `at`, and keep that latest time as `duration`.
|
|
509
|
+
*
|
|
510
|
+
* So `at` not being seconds does not break compatibility; the seconds are gathered into `duration`.
|
|
502
511
|
*/
|
|
503
512
|
export interface ParameterClip {
|
|
513
|
+
/** Seconds for a full move from 0 to 1. Missing or `0` means instant. */
|
|
514
|
+
duration?: number;
|
|
504
515
|
channels: AnimationChannel[];
|
|
505
516
|
}
|
|
506
517
|
/** 텍스트 표현 자리. 무엇을·언제만 정하고 수단은 런타임이 고른다. */
|
|
@@ -651,15 +662,22 @@ export interface PartCapability {
|
|
|
651
662
|
*/
|
|
652
663
|
direction?: Vec3;
|
|
653
664
|
}
|
|
654
|
-
/**
|
|
655
|
-
|
|
665
|
+
/**
|
|
666
|
+
* The source edition this format reads.
|
|
667
|
+
*
|
|
668
|
+
* - 1: `position.y` measured from the centre of the base box. Sources saved before the `version`
|
|
669
|
+
* field existed are edition 1 as well.
|
|
670
|
+
* - 2: `position.y` measured from the bottom face of the base box (ADR-0065).
|
|
671
|
+
*
|
|
672
|
+
* Only edition 2 is read. Older sources are refused with `source-version-unsupported` rather than
|
|
673
|
+
* read by the old rule, so a value never lives in two shapes at once.
|
|
674
|
+
*/
|
|
675
|
+
export declare const FIGURE_SOURCE_VERSION = 2;
|
|
656
676
|
/** 저작 결과. 편집 가능한 원본 데이터. */
|
|
657
677
|
export interface FigureSource {
|
|
658
678
|
/**
|
|
659
|
-
*
|
|
660
|
-
*
|
|
661
|
-
* 원본 데이터(JSON)의 스키마 버전을 명시한다.
|
|
662
|
-
* 형식이 변경될 때 마이그레이션 및 하위 호환 판정의 기준이 된다.
|
|
679
|
+
* Source edition. Must be `FIGURE_SOURCE_VERSION`; a missing value is refused, because every
|
|
680
|
+
* source saved without one was written in edition 1 coordinates.
|
|
663
681
|
*/
|
|
664
682
|
version?: number;
|
|
665
683
|
/** 컴포넌트 타입 이름. **저장되는 식별자다.** */
|
|
@@ -732,7 +750,23 @@ export declare const BLUEPRINT_VERSION = 1;
|
|
|
732
750
|
* 이름을 따로 두는 뜻이 있다. 닻을 `BlueprintMember` 로 억지로 맞추려면 없는 `geometryKey` 와
|
|
733
751
|
* `triangles` 를 지어내야 하고, 그 순간 그리는 목록에 섞여 들어갈 길이 생긴다.
|
|
734
752
|
*/
|
|
735
|
-
|
|
753
|
+
declare const CENTRED: unique symbol;
|
|
754
|
+
/**
|
|
755
|
+
* Marks a value whose positions are measured from the centre of the base box.
|
|
756
|
+
*
|
|
757
|
+
* A source measures y from the box bottom (edition 2); the blueprint, sizing, the release gate and the
|
|
758
|
+
* policy checks read box-centred positions. The brand exists only in the type system. Values get it in
|
|
759
|
+
* `origin.ts`, so a caller that hands a source part straight to a centred-only function fails to compile
|
|
760
|
+
* instead of reading every y half a box too high (ADR-0065).
|
|
761
|
+
*/
|
|
762
|
+
export type Centred<T> = T & {
|
|
763
|
+
readonly [CENTRED]: true;
|
|
764
|
+
};
|
|
765
|
+
/** A source whose parts have been moved into box-centred coordinates by `centredSource`. */
|
|
766
|
+
export type CentredSource = Centred<Omit<FigureSource, 'parts'> & {
|
|
767
|
+
parts: Centred<FigurePart>[];
|
|
768
|
+
}>;
|
|
769
|
+
interface SizingSubjectShape {
|
|
736
770
|
name: string;
|
|
737
771
|
transform: PartTransform;
|
|
738
772
|
sizing: SizingRule;
|
|
@@ -743,6 +777,8 @@ export interface SizingSubject {
|
|
|
743
777
|
primitive?: PrimitiveKind;
|
|
744
778
|
keepRound?: boolean;
|
|
745
779
|
}
|
|
780
|
+
/** What the sizing rules read: a part in box-centred coordinates. */
|
|
781
|
+
export type SizingSubject = Centred<SizingSubjectShape>;
|
|
746
782
|
export interface BlueprintMember extends SizingSubject {
|
|
747
783
|
name: string;
|
|
748
784
|
primitive: PrimitiveKind;
|
|
@@ -821,13 +857,13 @@ export interface Violation {
|
|
|
821
857
|
* 처리를 정해야 하는데, 코드가 늘어난 것이 알려지지 않으면 그 대응이 빠진다. 뜻은
|
|
822
858
|
* `docs/validation.md` 에 있고, 문서와 이 목록이 어긋나면 테스트가 실패한다.
|
|
823
859
|
*/
|
|
824
|
-
export declare const ERROR_CODES: readonly ["not-object", "not-finite", "not-positive", "out-of-range", "not-integer", "not-boolean", "not-allowed", "missing-type", "missing-base", "missing-parts", "bad-style-kit", "missing-name", "duplicate-name", "missing-transform", "missing-position", "missing-size", "too-few-segments", "missing-shape-path", "bad-shape-point", "hollow-too-thick", "hollow-not-convex", "bad-aspect-axis", "missing-material", "material-unresolvable", "missing-repeat", "missing-channels", "unknown-channel-target", "too-few-keys", "keys-out-of-order", "missing-surface-ref", "missing-label-name", "missing-label-source", "bad-capability", "duplicate-capability", "bad-part-capability", "missing-range", "bad-range"];
|
|
860
|
+
export declare const ERROR_CODES: readonly ["not-object", "not-finite", "not-positive", "out-of-range", "not-integer", "not-boolean", "not-allowed", "missing-type", "source-version-unsupported", "missing-base", "missing-parts", "bad-style-kit", "missing-name", "duplicate-name", "missing-transform", "missing-position", "missing-size", "too-few-segments", "missing-shape-path", "bad-shape-point", "hollow-too-thick", "hollow-not-convex", "bad-aspect-axis", "missing-material", "material-unresolvable", "missing-repeat", "missing-channels", "unknown-channel-target", "too-few-keys", "keys-out-of-order", "missing-surface-ref", "missing-label-name", "missing-label-source", "bad-capability", "duplicate-capability", "bad-part-capability", "missing-range", "bad-range"];
|
|
825
861
|
export type ErrorCode = (typeof ERROR_CODES)[number];
|
|
826
862
|
/**
|
|
827
863
|
* 위반 코드 전부. 위반은 컴파일을 막지 않는다 — 저작 화면이 알려 주는 데 쓴다.
|
|
828
864
|
* 뜻과 한도는 `docs/validation.md` 에 있다.
|
|
829
865
|
*/
|
|
830
|
-
export declare const VIOLATION_CODES: readonly ["segments-off-preset", "segments-ignored", "repeat-ignored", "keep-round-ignored", "hollow-ignored", "pivot-ignored", "detail-level-missing", "too-many-parts", "too-many-animated-parts", "too-many-material-groups", "too-many-transparent", "too-many-surface-textures", "capacity-with-repeat", "too-many-always-labels", "part-outside-base", "parts-off-placement-face"];
|
|
866
|
+
export declare const VIOLATION_CODES: readonly ["segments-off-preset", "segments-ignored", "repeat-ignored", "keep-round-ignored", "hollow-ignored", "pivot-ignored", "detail-level-missing", "too-many-parts", "too-many-animated-parts", "too-many-material-groups", "too-many-transparent", "too-many-surface-textures", "capacity-with-repeat", "too-many-always-labels", "part-outside-base", "parts-off-placement-face", "type-not-identifier", "type-is-placeholder"];
|
|
831
867
|
export type ViolationCode = (typeof VIOLATION_CODES)[number];
|
|
832
868
|
/**
|
|
833
869
|
* 발행을 막는 위반 — ADR-0044 결정 ② (`operato-twin/design/04-decisions.md`).
|
|
@@ -840,8 +876,32 @@ export type ViolationCode = (typeof VIOLATION_CODES)[number];
|
|
|
840
876
|
* 화면이 「이건 고쳐야 나간다」를 뜻으로 보여 줄 때. 서버가 제 목록을 들면 화면은 그것을
|
|
841
877
|
* 알 길이 없어 전부 같은 「알림」으로 그리고, 저작자는 발행이 막힌 것을 **눌러 보고 나서야**
|
|
842
878
|
* 안다. 코드를 소유한 자리가 등급도 소유한다.
|
|
879
|
+
*
|
|
880
|
+
* The two type-name codes belong here for the same reason: a drawing records the type, so a released
|
|
881
|
+
* name is a promise to consumers.
|
|
843
882
|
*/
|
|
844
883
|
export declare const RELEASE_BLOCKING_VIOLATIONS: readonly ViolationCode[];
|
|
884
|
+
/**
|
|
885
|
+
* The shape of a `type`: `SCREAMING_SNAKE_CASE` starting with a capital, 3 to 32 characters.
|
|
886
|
+
*
|
|
887
|
+
* Capitals are the figure namespace. Built-in scene components use lower-case kebab names, so a figure
|
|
888
|
+
* that follows this shape cannot share a name with one.
|
|
889
|
+
*/
|
|
890
|
+
export declare const TYPE_PATTERN: RegExp;
|
|
891
|
+
export declare const TYPE_LENGTH: {
|
|
892
|
+
readonly min: 3;
|
|
893
|
+
readonly max: 32;
|
|
894
|
+
};
|
|
895
|
+
/**
|
|
896
|
+
* The temporary type a figure carries before anyone names it. The format owns it so that the code
|
|
897
|
+
* making it and the code recognising it follow one rule: the authoring screen makes it, the release
|
|
898
|
+
* gate and the AI tools recognise it.
|
|
899
|
+
*
|
|
900
|
+
* It passes the identifier pattern (`FIGURE_MTU10FWR`), so the shape check alone would not catch it.
|
|
901
|
+
*/
|
|
902
|
+
export declare function placeholderType(now?: number): string;
|
|
903
|
+
/** Whether a type is the temporary name given before anyone names the figure. */
|
|
904
|
+
export declare function isPlaceholderType(type: string): boolean;
|
|
845
905
|
/** 이 위반이 발행을 막나. */
|
|
846
906
|
export declare function blocksRelease(code: string): boolean;
|
|
847
907
|
/** 형식·정합성 오류. 이것이 있으면 컴파일할 수 없다. */
|
|
@@ -893,8 +953,6 @@ export interface FigureBlueprint {
|
|
|
893
953
|
animations: BlueprintClip[];
|
|
894
954
|
/**
|
|
895
955
|
* 값이 모는 자세. 인스턴스가 이름으로 값을 준다.
|
|
896
|
-
*
|
|
897
|
-
* 옛 원본의 `drive: 'hold'` clip 도 여기로 온다 — `compile()` 이 옮긴다.
|
|
898
956
|
*/
|
|
899
957
|
parameters: BlueprintParameter[];
|
|
900
958
|
labels: BlueprintLabel[];
|
|
@@ -988,4 +1046,5 @@ export declare const LIMITS: {
|
|
|
988
1046
|
* 화면이 표현하지 못한다. 삼각형만 192 에서 256 으로 는다.
|
|
989
1047
|
*/
|
|
990
1048
|
export declare const SEGMENT_PRESETS: readonly number[];
|
|
1049
|
+
export {};
|
|
991
1050
|
//# sourceMappingURL=types.d.ts.map
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAqBA,8CAA8C;AAC9C,eAAO,MAAM,eAAe,oEAAqE,CAAA;AACjG,MAAM,MAAM,aAAa,GAAG,CAAC,OAAO,eAAe,CAAC,CAAC,MAAM,CAAC,CAAA;AAE5D,+BAA+B;AAC/B,eAAO,MAAM,kBAAkB,EAAE,SAAS,aAAa,EAAwB,CAAA;AAE/E,oCAAoC;AACpC,eAAO,MAAM,eAAe,EAAE,SAAS,aAAa,EAA2C,CAAA;AAE/F,kCAAkC;AAClC,eAAO,MAAM,oBAAoB,EAAE,SAAS,aAAa,EAA2B,CAAA;AAEpF;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,EAAE,SAAS,aAAa,EAA2B,CAAA;AAEjF;;;GAGG;AACH,eAAO,MAAM,cAAc,0BAA2B,CAAA;AACtD,MAAM,MAAM,YAAY,GAAG,CAAC,OAAO,cAAc,CAAC,CAAC,MAAM,CAAC,CAAA;AAE1D,0DAA0D;AAC1D,eAAO,MAAM,gBAAgB,gFAAiF,CAAA;AAC9G,MAAM,MAAM,cAAc,GAAG,CAAC,OAAO,gBAAgB,CA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AAE,kBAAkB,EAAE,CAAA;IAChC,MAAM,EAAE,cAAc,EAAE,CAAA;IACxB;;;;;OAKG;IACH,YAAY,EAAE,SAAS,MAAM,EAAE,CAAA;IAC/B,UAAU,EAAE,SAAS,EAAE,CAAA;CACxB;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,IAAI,MAAM,CAAA;AAIvB;;;;;;;GAOG;AACH,eAAO,MAAM,MAAM;IACjB,kBAAkB;;IAElB,gDAAgD;;IAEhD,wBAAwB;;IAExB;;;;;;;OAOG;;IAEH,iCAAiC;;CAEzB,CAAA;AAEV;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AACH,eAAO,MAAM,eAAe,EAAE,SAAS,MAAM,EAA4B,CAAA"}
|
package/dist/types.js
CHANGED
|
@@ -197,18 +197,6 @@ export const PART_LIMIT = { S: 3, M: 8, L: 20 };
|
|
|
197
197
|
export const CHANNEL_PATHS = ['translation', 'rotation', 'scale'];
|
|
198
198
|
/** 키프레임 사이를 어떻게 잇나. glTF 의 `CUBICSPLINE` 은 없다 — 접선을 손으로 적을 형식이 아니다. */
|
|
199
199
|
export const INTERPOLATIONS = ['linear', 'step'];
|
|
200
|
-
/**
|
|
201
|
-
* **옛 자리다. 저작하지 않는다.**
|
|
202
|
-
*
|
|
203
|
-
* `drive: 'hold'` 가 「값이 자세를 만든다」를 말하던 칸이었다. 그 판단은 맞았는데 자리가
|
|
204
|
-
* 틀려서, 애니메이션 안에 숨은 채로 아무도 못 찾았다. 지금은 `FigureParameter` 가 제 칸으로
|
|
205
|
-
* 있고 `animations` 에는 시각이 흐르는 것만 남는다 — 그러니 여기서 말할 것이 없다
|
|
206
|
-
* (ADR-0051, `operato-twin/design/04-decisions.md`).
|
|
207
|
-
*
|
|
208
|
-
* 이름이 남아 있는 것은 **이미 저장된 것을 옮기기 위해서**다. `compile()` 이 옛 원본의
|
|
209
|
-
* `drive: 'hold'` 를 읽어 `parameters` 로 옮긴다. 옮기는 쪽이 사라지면 이 이름도 사라진다.
|
|
210
|
-
*/
|
|
211
|
-
export const CLIP_DRIVES = ['loop', 'hold'];
|
|
212
200
|
export const AXES = ['x', 'y', 'z'];
|
|
213
201
|
/** 텍스트를 언제 보이나. 표현 수단(sprite·overlay)은 런타임이 고른다. */
|
|
214
202
|
export const LABEL_WHENS = ['always', 'zoomed', 'selected', 'abnormal'];
|
|
@@ -233,8 +221,17 @@ export const SURFACE_KINDS = ['gradient', 'pattern'];
|
|
|
233
221
|
* port-out 흐름이 나가는 문 (`FlowNode.outboundPorts`)
|
|
234
222
|
*/
|
|
235
223
|
export const PART_ROLES = ['slot', 'port-in', 'port-out'];
|
|
236
|
-
/**
|
|
237
|
-
|
|
224
|
+
/**
|
|
225
|
+
* The source edition this format reads.
|
|
226
|
+
*
|
|
227
|
+
* - 1: `position.y` measured from the centre of the base box. Sources saved before the `version`
|
|
228
|
+
* field existed are edition 1 as well.
|
|
229
|
+
* - 2: `position.y` measured from the bottom face of the base box (ADR-0065).
|
|
230
|
+
*
|
|
231
|
+
* Only edition 2 is read. Older sources are refused with `source-version-unsupported` rather than
|
|
232
|
+
* read by the old rule, so a value never lives in two shapes at once.
|
|
233
|
+
*/
|
|
234
|
+
export const FIGURE_SOURCE_VERSION = 2;
|
|
238
235
|
// ─── 청사진 ────────────────────────────────────────────────────────────────
|
|
239
236
|
/** 청사진 스키마 버전. 형식이 바뀌면 올린다. */
|
|
240
237
|
export const BLUEPRINT_VERSION = 1;
|
|
@@ -258,6 +255,8 @@ export const ERROR_CODES = [
|
|
|
258
255
|
'not-allowed',
|
|
259
256
|
// 원본의 필수 항목
|
|
260
257
|
'missing-type',
|
|
258
|
+
/* The source was written in an edition this format no longer reads. See FIGURE_SOURCE_VERSION. */
|
|
259
|
+
'source-version-unsupported',
|
|
261
260
|
'missing-base',
|
|
262
261
|
'missing-parts',
|
|
263
262
|
'bad-style-kit',
|
|
@@ -340,7 +339,16 @@ export const VIOLATION_CODES = [
|
|
|
340
339
|
것은 부품을 제자리로 옮기는 것인데.
|
|
341
340
|
*/
|
|
342
341
|
'part-outside-base',
|
|
343
|
-
'parts-off-placement-face'
|
|
342
|
+
'parts-off-placement-face',
|
|
343
|
+
/*
|
|
344
|
+
Type names. `type` is the stored identifier a drawing writes as `{ type, left, top, width, height }`,
|
|
345
|
+
so once released it cannot change. The rules hold back a release and leave draft saves alone:
|
|
346
|
+
trying something out before naming it is fine. These are two separate defects. One is a name of
|
|
347
|
+
the wrong shape; the other has the right shape but was never named by a person (chief architect
|
|
348
|
+
ruling, 2026-09-17).
|
|
349
|
+
*/
|
|
350
|
+
'type-not-identifier',
|
|
351
|
+
'type-is-placeholder'
|
|
344
352
|
];
|
|
345
353
|
/**
|
|
346
354
|
* 발행을 막는 위반 — ADR-0044 결정 ② (`operato-twin/design/04-decisions.md`).
|
|
@@ -353,8 +361,39 @@ export const VIOLATION_CODES = [
|
|
|
353
361
|
* 화면이 「이건 고쳐야 나간다」를 뜻으로 보여 줄 때. 서버가 제 목록을 들면 화면은 그것을
|
|
354
362
|
* 알 길이 없어 전부 같은 「알림」으로 그리고, 저작자는 발행이 막힌 것을 **눌러 보고 나서야**
|
|
355
363
|
* 안다. 코드를 소유한 자리가 등급도 소유한다.
|
|
364
|
+
*
|
|
365
|
+
* The two type-name codes belong here for the same reason: a drawing records the type, so a released
|
|
366
|
+
* name is a promise to consumers.
|
|
356
367
|
*/
|
|
357
|
-
export const RELEASE_BLOCKING_VIOLATIONS = [
|
|
368
|
+
export const RELEASE_BLOCKING_VIOLATIONS = [
|
|
369
|
+
'part-outside-base',
|
|
370
|
+
'parts-off-placement-face',
|
|
371
|
+
'type-not-identifier',
|
|
372
|
+
'type-is-placeholder'
|
|
373
|
+
];
|
|
374
|
+
/**
|
|
375
|
+
* The shape of a `type`: `SCREAMING_SNAKE_CASE` starting with a capital, 3 to 32 characters.
|
|
376
|
+
*
|
|
377
|
+
* Capitals are the figure namespace. Built-in scene components use lower-case kebab names, so a figure
|
|
378
|
+
* that follows this shape cannot share a name with one.
|
|
379
|
+
*/
|
|
380
|
+
export const TYPE_PATTERN = /^[A-Z][A-Z0-9]*(_[A-Z0-9]+)*$/;
|
|
381
|
+
export const TYPE_LENGTH = { min: 3, max: 32 };
|
|
382
|
+
/**
|
|
383
|
+
* The temporary type a figure carries before anyone names it. The format owns it so that the code
|
|
384
|
+
* making it and the code recognising it follow one rule: the authoring screen makes it, the release
|
|
385
|
+
* gate and the AI tools recognise it.
|
|
386
|
+
*
|
|
387
|
+
* It passes the identifier pattern (`FIGURE_MTU10FWR`), so the shape check alone would not catch it.
|
|
388
|
+
*/
|
|
389
|
+
export function placeholderType(now = Date.now()) {
|
|
390
|
+
return `FIGURE_${now.toString(36).toUpperCase()}`;
|
|
391
|
+
}
|
|
392
|
+
const PLACEHOLDER_TYPE = /^FIGURE_[0-9A-Z]{8}$/;
|
|
393
|
+
/** Whether a type is the temporary name given before anyone names the figure. */
|
|
394
|
+
export function isPlaceholderType(type) {
|
|
395
|
+
return PLACEHOLDER_TYPE.test(type);
|
|
396
|
+
}
|
|
358
397
|
/** 이 위반이 발행을 막나. */
|
|
359
398
|
export function blocksRelease(code) {
|
|
360
399
|
return RELEASE_BLOCKING_VIOLATIONS.includes(code);
|
package/dist/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,8CAA8C;AAC9C,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,CAAU,CAAA;AAGjG,+BAA+B;AAC/B,MAAM,CAAC,MAAM,kBAAkB,GAA6B,CAAC,MAAM,EAAE,SAAS,CAAC,CAAA;AAE/E,oCAAoC;AACpC,MAAM,CAAC,MAAM,eAAe,GAA6B,CAAC,MAAM,EAAE,MAAM,EAAE,UAAU,EA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UAAU,iBAAiB,CAAC,IAAY;IAC5C,OAAO,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;AACpC,CAAC;AAED,oBAAoB;AACpB,MAAM,UAAU,aAAa,CAAC,IAAY;IACxC,OAAQ,2BAAiD,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAA;AAC1E,CAAC;AAiED;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,IAAI,GAAG,GAAG,CAAA;AAEvB,0EAA0E;AAE1E;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG;IACpB,kBAAkB;IAClB,cAAc,EAAE,CAAC;IACjB,gDAAgD;IAChD,aAAa,EAAE,CAAC;IAChB,wBAAwB;IACxB,oBAAoB,EAAE,CAAC;IACvB;;;;;;;OAOG;IACH,eAAe,EAAE,CAAC;IAClB,iCAAiC;IACjC,WAAW,EAAE,CAAC;CACN,CAAA;AAEV;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AACH,MAAM,CAAC,MAAM,eAAe,GAAsB,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,CAAA"}
|
package/dist/validate.d.ts
CHANGED
|
@@ -3,11 +3,5 @@ export interface ValidateResult {
|
|
|
3
3
|
errors: FigureError[];
|
|
4
4
|
violations: Violation[];
|
|
5
5
|
}
|
|
6
|
-
/**
|
|
7
|
-
* 원본 데이터를 검증한다.
|
|
8
|
-
*
|
|
9
|
-
* 바깥에서 온 데이터(DB · API · 파일)를 받으므로 `unknown` 을 받는다.
|
|
10
|
-
* `errors` 가 비어 있으면 `source` 는 `FigureSource` 로 다룰 수 있다.
|
|
11
|
-
*/
|
|
12
6
|
export declare function validate(source: unknown): ValidateResult;
|
|
13
7
|
//# sourceMappingURL=validate.d.ts.map
|
package/dist/validate.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validate.d.ts","sourceRoot":"","sources":["../src/validate.ts"],"names":[],"mappings":"AAqBA,OAAO,
|
|
1
|
+
{"version":3,"file":"validate.d.ts","sourceRoot":"","sources":["../src/validate.ts"],"names":[],"mappings":"AAqBA,OAAO,EAyBL,KAAK,WAAW,EAIhB,KAAK,SAAS,EAMf,MAAM,YAAY,CAAA;AASnB,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,WAAW,EAAE,CAAA;IACrB,UAAU,EAAE,SAAS,EAAE,CAAA;CACxB;AAy5BD,wBAAgB,QAAQ,CAAC,MAAM,EAAE,OAAO,GAAG,cAAc,CAgFxD"}
|
package/dist/validate.js
CHANGED
|
@@ -18,9 +18,10 @@
|
|
|
18
18
|
* 결측을 기본값으로 갈음하지 않는다. 값이 없는 것과 0 인 것은 다르고, 갈음하면
|
|
19
19
|
* 저작자가 빠뜨린 것을 알 수 없다.
|
|
20
20
|
*/
|
|
21
|
-
import { ANCHOR_RULES, AXES, CAPABILITY_NEEDS, FIGURE_CAPABILITIES, CURVED_PRIMITIVES, EXTRUDE_PRIMITIVES, CHANNEL_PATHS, DEFAULT_SIZING,
|
|
22
|
-
import {
|
|
21
|
+
import { ANCHOR_RULES, AXES, CAPABILITY_NEEDS, FIGURE_CAPABILITIES, CURVED_PRIMITIVES, EXTRUDE_PRIMITIVES, CHANNEL_PATHS, DEFAULT_SIZING, DETAIL_LEVELS, FIGURE_PLACEMENTS, LABEL_WHENS, LIMITS, MATERIAL_PRESETS, MATERIAL_SLOTS, INTERPOLATIONS, PART_LIMIT, PART_ROLES, PRIMITIVE_KINDS, SEGMENTED_PRIMITIVES, SEGMENT_PRESETS, SIZING_RULES, SKIN, SURFACE_KINDS, isPlaceholderType, TYPE_LENGTH, TYPE_PATTERN, FIGURE_SOURCE_VERSION } from "./types.js";
|
|
22
|
+
import { drawCallsOf, isDrawn, movingNames } from "./grouping.js";
|
|
23
23
|
import { rotatedExtentOf } from "./blueprint.js";
|
|
24
|
+
import { centredSource } from "./origin.js";
|
|
24
25
|
import { groupKeyOf } from "./keys.js";
|
|
25
26
|
function isObject(v) {
|
|
26
27
|
return typeof v === 'object' && v !== null && !Array.isArray(v);
|
|
@@ -477,8 +478,14 @@ function checkAnimations(c, source) {
|
|
|
477
478
|
else {
|
|
478
479
|
names.add(raw.name);
|
|
479
480
|
}
|
|
480
|
-
|
|
481
|
-
|
|
481
|
+
/*
|
|
482
|
+
`drive` held a value-driven pose as 'hold' before parameters had their own field (ADR-0051).
|
|
483
|
+
Stored sources were moved when edition 2 arrived (ADR-0065), so the field is refused rather
|
|
484
|
+
than read by an old rule.
|
|
485
|
+
*/
|
|
486
|
+
if (raw.drive !== undefined) {
|
|
487
|
+
c.error('not-allowed', `${path}.drive`, 'drive 칸은 없어졌다. 값으로 움직이는 자세는 parameters 에 적는다');
|
|
488
|
+
}
|
|
482
489
|
checkChannels(c, raw.channels, path, parts);
|
|
483
490
|
});
|
|
484
491
|
}
|
|
@@ -611,6 +618,30 @@ function checkParameters(c, source, clipNames) {
|
|
|
611
618
|
return;
|
|
612
619
|
}
|
|
613
620
|
checkChannels(c, clip.channels, `${path}.clip`, parts);
|
|
621
|
+
/*
|
|
622
|
+
Transition time. 0 is accepted because it means instant. A negative value has no meaning.
|
|
623
|
+
*/
|
|
624
|
+
if (clip.duration !== undefined && c.finite(clip.duration, `${path}.clip.duration`, 'duration')) {
|
|
625
|
+
if (clip.duration < 0) {
|
|
626
|
+
c.error('not-positive', `${path}.clip.duration`, 'duration 은 0 이상이어야 한다. 0 이면 즉시 움직인다');
|
|
627
|
+
}
|
|
628
|
+
}
|
|
629
|
+
/*
|
|
630
|
+
Parameter keys sit on the value span. A key above 1 is a pose no value can reach, which means
|
|
631
|
+
the author wrote seconds. Refuse it here instead of leaving an unreachable pose. Negative keys
|
|
632
|
+
and key order are already checked in checkChannels.
|
|
633
|
+
*/
|
|
634
|
+
if (Array.isArray(clip.channels)) {
|
|
635
|
+
clip.channels.forEach((channel, index) => {
|
|
636
|
+
if (!isObject(channel) || !Array.isArray(channel.keys))
|
|
637
|
+
return;
|
|
638
|
+
channel.keys.forEach((key, k) => {
|
|
639
|
+
if (isObject(key) && isFiniteNumber(key.at) && key.at > 1) {
|
|
640
|
+
c.error('out-of-range', `${path}.clip.channels[${index}].keys[${k}].at`, '파라미터 키의 at 은 0~1 사이여야 한다. 전이 시간은 clip.duration 에 적는다');
|
|
641
|
+
}
|
|
642
|
+
});
|
|
643
|
+
});
|
|
644
|
+
}
|
|
614
645
|
});
|
|
615
646
|
}
|
|
616
647
|
function checkCapabilities(c, source) {
|
|
@@ -679,7 +710,7 @@ function checkPolicy(c, source) {
|
|
|
679
710
|
c.violate('too-many-parts', `등급 ${source.detailLevel} 의 부품 수 한도를 넘었다`, parts.length, limit);
|
|
680
711
|
}
|
|
681
712
|
}
|
|
682
|
-
const moving =
|
|
713
|
+
const moving = movingNames(source);
|
|
683
714
|
if (moving.size > LIMITS.animatedParts) {
|
|
684
715
|
c.violate('too-many-animated-parts', '움직이는 부품이 많다 — 저마다 단독 묶음이고 프레임마다 갱신한다', moving.size, LIMITS.animatedParts);
|
|
685
716
|
}
|
|
@@ -782,6 +813,20 @@ function checkBaseBox(c, source) {
|
|
|
782
813
|
* 바깥에서 온 데이터(DB · API · 파일)를 받으므로 `unknown` 을 받는다.
|
|
783
814
|
* `errors` 가 비어 있으면 `source` 는 `FigureSource` 로 다룰 수 있다.
|
|
784
815
|
*/
|
|
816
|
+
/**
|
|
817
|
+
* Type name: its shape, and whether a person has named it. These are violations that hold back a
|
|
818
|
+
* release, not errors. Building something before naming it is fine; what gets blocked is the release
|
|
819
|
+
* that makes a promise to drawings.
|
|
820
|
+
*/
|
|
821
|
+
function checkTypeName(c, type) {
|
|
822
|
+
if (isPlaceholderType(type)) {
|
|
823
|
+
c.violate('type-is-placeholder', `type '${type}' 은 임시 이름이다. 발행하려면 이름을 정한다`);
|
|
824
|
+
return;
|
|
825
|
+
}
|
|
826
|
+
if (!TYPE_PATTERN.test(type) || type.length < TYPE_LENGTH.min || type.length > TYPE_LENGTH.max) {
|
|
827
|
+
c.violate('type-not-identifier', `type '${type}' 은 대문자 SCREAMING_SNAKE_CASE ${TYPE_LENGTH.min}~${TYPE_LENGTH.max} 자여야 한다`);
|
|
828
|
+
}
|
|
829
|
+
}
|
|
785
830
|
export function validate(source) {
|
|
786
831
|
const c = new Collector();
|
|
787
832
|
if (!isObject(source)) {
|
|
@@ -791,10 +836,15 @@ export function validate(source) {
|
|
|
791
836
|
if (!isNonEmptyString(source.type)) {
|
|
792
837
|
c.error('missing-type', 'type', 'type 이 없다 — 저장되는 식별자다');
|
|
793
838
|
}
|
|
794
|
-
if (source.version !== undefined) {
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
839
|
+
if (source.version !== undefined && (typeof source.version !== 'number' || !Number.isInteger(source.version) || source.version <= 0)) {
|
|
840
|
+
c.error('not-positive', 'version', 'version 은 양의 정수여야 한다');
|
|
841
|
+
}
|
|
842
|
+
else if (source.version !== FIGURE_SOURCE_VERSION) {
|
|
843
|
+
/*
|
|
844
|
+
A missing version is refused too. Sources saved before the field existed were written with y
|
|
845
|
+
measured from the box centre, so reading them as the current edition would move every part.
|
|
846
|
+
*/
|
|
847
|
+
c.error('source-version-unsupported', 'version', `원본 판이 ${source.version ?? '없음'} 이다. 판 ${FIGURE_SOURCE_VERSION} 원본만 읽는다`);
|
|
798
848
|
}
|
|
799
849
|
if (!isObject(source.base)) {
|
|
800
850
|
c.error('missing-base', 'base', 'base 가 없다 — 배치 비율의 근거다');
|
|
@@ -833,8 +883,10 @@ export function validate(source) {
|
|
|
833
883
|
/* 능력 선언의 모양 — 부품과 무관하므로 순서를 따지지 않는다 */
|
|
834
884
|
checkCapabilities(c, source);
|
|
835
885
|
// 정책 검사는 형식이 성립할 때만 뜻이 있다
|
|
836
|
-
if (c.errors.length === 0)
|
|
837
|
-
|
|
886
|
+
if (c.errors.length === 0) {
|
|
887
|
+
checkTypeName(c, source.type);
|
|
888
|
+
checkPolicy(c, centredSource(source));
|
|
889
|
+
}
|
|
838
890
|
return { errors: c.errors, violations: c.violations };
|
|
839
891
|
}
|
|
840
892
|
//# sourceMappingURL=validate.js.map
|