@ryusenkei/maezae 0.18.0 → 0.18.1
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/body.js +27 -22
- package/dist/dev.js +8 -1
- package/dist/model.js +126 -216
- package/dist/types/body/src/inline.d.ts +20 -0
- package/dist/types/body/src/normalize.d.ts +1 -3
- package/dist/types/model/src/asset.d.ts +16 -0
- package/dist/types/model/src/index.d.ts +2 -2
- package/dist/types/model/src/model.d.ts +1 -1
- package/dist/types/{sdk/src/defaults.d.ts → platform/src/defaultModel.d.ts} +4 -1
- package/dist/types/sdk/src/delivery/index.d.ts +2 -2
- package/dist/types/sdk/src/delivery/values.d.ts +1 -17
- package/dist/types/sdk/src/model.d.ts +1 -1
- package/package.json +1 -1
package/dist/body.js
CHANGED
|
@@ -72,6 +72,32 @@ const SAFE_HREF = /^(?:https?:\/\/|mailto:|#|\/(?![/\\]))/i;
|
|
|
72
72
|
const isSafeHref = (href) => SAFE_HREF.test(href);
|
|
73
73
|
/** 許可しないリンク先の問題の文言 */
|
|
74
74
|
const unsafeHrefMessage = (href) => `リンク先 ${href} は使えない(https://・http://・mailto:・/ で始まるサイト内のパス・# で始まるページ内のリンクだけ)`;
|
|
75
|
+
// ../body/src/inline.ts
|
|
76
|
+
/** 装飾の順序(外側から内側、Markdown と HTML の入れ子の順) */
|
|
77
|
+
const MARK_ORDER = [
|
|
78
|
+
"strong",
|
|
79
|
+
"em",
|
|
80
|
+
"strike",
|
|
81
|
+
"underline",
|
|
82
|
+
"mark",
|
|
83
|
+
"sup",
|
|
84
|
+
"sub",
|
|
85
|
+
"code"
|
|
86
|
+
];
|
|
87
|
+
/** 装飾を MARK_ORDER の順に並べる(重複は1つ) */
|
|
88
|
+
const sortMarks = (marks) => MARK_ORDER.filter((m) => marks?.includes(m));
|
|
89
|
+
/** 装飾の描画の HTML の要素 */
|
|
90
|
+
const MARK_HTML_TAGS = {
|
|
91
|
+
strong: "strong",
|
|
92
|
+
em: "em",
|
|
93
|
+
code: "code",
|
|
94
|
+
strike: "s",
|
|
95
|
+
mark: "mark",
|
|
96
|
+
sup: "sup",
|
|
97
|
+
sub: "sub",
|
|
98
|
+
underline: "u"
|
|
99
|
+
};
|
|
100
|
+
({ ...Object.fromEntries(Object.entries(MARK_HTML_TAGS).map(([mark, tag]) => [tag, mark])) });
|
|
75
101
|
// ../body/src/profile.ts
|
|
76
102
|
const MARK_LABELS = {
|
|
77
103
|
strong: "太字",
|
|
@@ -240,27 +266,6 @@ const ESCAPES = {
|
|
|
240
266
|
};
|
|
241
267
|
const esc = (s) => s.replace(/[&<>"']/g, (c) => ESCAPES[c]);
|
|
242
268
|
const attrs = (pairs) => Object.entries(pairs).filter(([, v]) => v !== void 0 && v !== null && v !== false && v !== "").map(([k, v]) => ` ${k}="${esc(String(v))}"`).join("");
|
|
243
|
-
const MARK_TAGS = {
|
|
244
|
-
strong: "strong",
|
|
245
|
-
em: "em",
|
|
246
|
-
code: "code",
|
|
247
|
-
strike: "s",
|
|
248
|
-
mark: "mark",
|
|
249
|
-
sup: "sup",
|
|
250
|
-
sub: "sub",
|
|
251
|
-
underline: "u"
|
|
252
|
-
};
|
|
253
|
-
/** 外側から内側の順 */
|
|
254
|
-
const MARK_ORDER = [
|
|
255
|
-
"strong",
|
|
256
|
-
"em",
|
|
257
|
-
"strike",
|
|
258
|
-
"underline",
|
|
259
|
-
"mark",
|
|
260
|
-
"sup",
|
|
261
|
-
"sub",
|
|
262
|
-
"code"
|
|
263
|
-
];
|
|
264
269
|
const CSS_PROPERTY = {
|
|
265
270
|
color: "color",
|
|
266
271
|
background: "background-color",
|
|
@@ -294,7 +299,7 @@ function bodyToHtml(body, options) {
|
|
|
294
299
|
if (typeof i === "string") return esc(i).replaceAll("\n", "<br>");
|
|
295
300
|
if ("component" in i) return options.inlineComponent?.(i.component, i.props ?? {}, i.text ?? "") ?? esc(i.text ?? "");
|
|
296
301
|
let html = esc(i.text).replaceAll("\n", "<br>");
|
|
297
|
-
for (const m of
|
|
302
|
+
for (const m of sortMarks(i.marks).reverse()) html = `<${MARK_HTML_TAGS[m]}>${html}</${MARK_HTML_TAGS[m]}>`;
|
|
298
303
|
if (i.style) {
|
|
299
304
|
const a = styleAttr(i.style);
|
|
300
305
|
if (a) html = `<span${a}>${html}</span>`;
|
package/dist/dev.js
CHANGED
|
@@ -49,6 +49,11 @@ function relayDelivery({ origin, apiKey, previewSecret }) {
|
|
|
49
49
|
});
|
|
50
50
|
};
|
|
51
51
|
}
|
|
52
|
+
const DECODED_BODY_HEADERS = /* @__PURE__ */ new Set([
|
|
53
|
+
"content-encoding",
|
|
54
|
+
"content-length",
|
|
55
|
+
"transfer-encoding"
|
|
56
|
+
]);
|
|
52
57
|
/** 手元の配信 API のサーバー(/content/v1/… だけ、失敗は502、戻り値は origin と停止の関数) */
|
|
53
58
|
async function serveDelivery(delivery, options = {}) {
|
|
54
59
|
const server = createServer(async (req, res) => {
|
|
@@ -67,7 +72,9 @@ async function serveDelivery(delivery, options = {}) {
|
|
|
67
72
|
...chunks.length ? { body: Buffer.concat(chunks).toString("utf8") } : {}
|
|
68
73
|
});
|
|
69
74
|
const out = {};
|
|
70
|
-
response.headers.forEach((v, k) =>
|
|
75
|
+
response.headers.forEach((v, k) => {
|
|
76
|
+
if (!DECODED_BODY_HEADERS.has(k)) out[k] = v;
|
|
77
|
+
});
|
|
71
78
|
res.writeHead(response.status, out);
|
|
72
79
|
res.end(Buffer.from(await response.arrayBuffer()));
|
|
73
80
|
} catch (e) {
|
package/dist/model.js
CHANGED
|
@@ -511,6 +511,9 @@ const modelSchema = z.object({
|
|
|
511
511
|
/** コンテンツスキーマの JSON を検査して返却(形が合わなければ例外、理由は zod の issues) */
|
|
512
512
|
const parseModel = (json) => modelSchema.parse(normalizeLegacyModel(json));
|
|
513
513
|
// ../model/src/screens.ts
|
|
514
|
+
const TYPE_PREFIX = "type:";
|
|
515
|
+
/** メニュー項目の id(コンテンツタイプ) */
|
|
516
|
+
const typeItem = (type) => `${TYPE_PREFIX}${type}`;
|
|
514
517
|
/** メニューにある全項目の id(グループの中も、上から順) */
|
|
515
518
|
const menuItemsOf = (menu) => menu.flatMap((e) => typeof e === "string" ? [e] : e.items);
|
|
516
519
|
/** 編集画面に配置した項目の id(セクションの順) */
|
|
@@ -544,296 +547,203 @@ const parseScreens = (json) => screensSchema.parse(json);
|
|
|
544
547
|
// ../cms-contract/src/transfer.ts
|
|
545
548
|
/** スキーマと設定の形式の名前 */
|
|
546
549
|
const CONFIG_FORMAT = "cms-config";
|
|
547
|
-
// src/defaults.ts
|
|
548
550
|
/** 中立の既定のスキーマ(新しい媒体の作成で適用する型: post・author・tag・image・video、設定の移入の土台) */
|
|
549
|
-
const DEFAULT_SCHEMA = {
|
|
551
|
+
const DEFAULT_SCHEMA = { types: [
|
|
550
552
|
{
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
553
|
+
id: "post",
|
|
554
|
+
label: "投稿",
|
|
555
|
+
publishing: "review",
|
|
556
|
+
roles: {
|
|
557
|
+
title: "title",
|
|
558
|
+
image: "image",
|
|
559
|
+
body: "body"
|
|
558
560
|
},
|
|
559
|
-
|
|
561
|
+
fields: [
|
|
560
562
|
{
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
563
|
+
key: "title",
|
|
564
|
+
label: "タイトル",
|
|
565
|
+
type: "text",
|
|
566
|
+
required: "save"
|
|
565
567
|
},
|
|
566
568
|
{
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
569
|
+
key: "writers",
|
|
570
|
+
label: "著者",
|
|
571
|
+
type: "reference",
|
|
572
|
+
to: "author",
|
|
573
|
+
multiple: true
|
|
572
574
|
},
|
|
573
575
|
{
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
576
|
+
key: "image",
|
|
577
|
+
label: "メインの画像",
|
|
578
|
+
type: "media",
|
|
579
|
+
accept: ["image"]
|
|
578
580
|
},
|
|
579
581
|
{
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
582
|
+
key: "body",
|
|
583
|
+
label: "本文",
|
|
584
|
+
type: "body",
|
|
585
|
+
profile: {
|
|
586
|
+
headings: [
|
|
585
587
|
2,
|
|
586
588
|
3,
|
|
587
589
|
4
|
|
588
590
|
],
|
|
589
|
-
|
|
591
|
+
marks: [
|
|
590
592
|
"strong",
|
|
591
593
|
"em",
|
|
592
594
|
"code",
|
|
593
595
|
"strike"
|
|
594
596
|
],
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
597
|
+
list: {
|
|
598
|
+
ordered: true,
|
|
599
|
+
nested: true
|
|
598
600
|
},
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
601
|
+
quote: {
|
|
602
|
+
multiple: true,
|
|
603
|
+
cite: true
|
|
602
604
|
},
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
605
|
+
code: { caption: false },
|
|
606
|
+
table: {
|
|
607
|
+
head: "optional",
|
|
608
|
+
caption: "optional"
|
|
607
609
|
},
|
|
608
|
-
|
|
609
|
-
|
|
610
|
+
divider: true,
|
|
611
|
+
components: ["gallery", "link-card"]
|
|
610
612
|
}
|
|
611
613
|
},
|
|
612
614
|
{
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
615
|
+
key: "revised_at",
|
|
616
|
+
label: "更新日時",
|
|
617
|
+
type: "datetime"
|
|
616
618
|
},
|
|
617
619
|
{
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
620
|
+
key: "tags",
|
|
621
|
+
label: "タグ",
|
|
622
|
+
type: "reference",
|
|
623
|
+
to: "tag",
|
|
624
|
+
multiple: true
|
|
623
625
|
},
|
|
624
626
|
{
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
627
|
+
key: "excerpt",
|
|
628
|
+
label: "抜粋",
|
|
629
|
+
type: "textarea",
|
|
630
|
+
computed: {
|
|
631
|
+
kind: "excerpt",
|
|
632
|
+
from: "body"
|
|
631
633
|
}
|
|
632
634
|
},
|
|
633
635
|
{
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
636
|
+
key: "read_min",
|
|
637
|
+
label: "読了の分",
|
|
638
|
+
type: "number",
|
|
639
|
+
computed: {
|
|
640
|
+
kind: "read_min",
|
|
641
|
+
from: "body"
|
|
640
642
|
}
|
|
641
643
|
},
|
|
642
644
|
{
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
645
|
+
key: "links",
|
|
646
|
+
label: "リンク先",
|
|
647
|
+
type: "text",
|
|
648
|
+
multiple: true,
|
|
649
|
+
computed: {
|
|
650
|
+
kind: "links",
|
|
651
|
+
from: "body"
|
|
650
652
|
}
|
|
651
653
|
}
|
|
652
654
|
],
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
655
|
+
pages: [{
|
|
656
|
+
path: "/posts/{id}",
|
|
657
|
+
public: [{
|
|
658
|
+
key: "status",
|
|
659
|
+
in: ["published"]
|
|
658
660
|
}, {
|
|
659
|
-
|
|
660
|
-
|
|
661
|
+
key: "published_at",
|
|
662
|
+
notFuture: true
|
|
661
663
|
}]
|
|
662
664
|
}]
|
|
663
665
|
},
|
|
664
666
|
{
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
667
|
+
id: "author",
|
|
668
|
+
label: "著者",
|
|
669
|
+
roles: {
|
|
670
|
+
title: "name",
|
|
671
|
+
image: "portrait"
|
|
670
672
|
},
|
|
671
|
-
|
|
673
|
+
fields: [
|
|
672
674
|
{
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
675
|
+
key: "name",
|
|
676
|
+
label: "名前",
|
|
677
|
+
type: "text",
|
|
678
|
+
required: "save"
|
|
677
679
|
},
|
|
678
680
|
{
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
681
|
+
key: "bio",
|
|
682
|
+
label: "紹介",
|
|
683
|
+
type: "textarea"
|
|
682
684
|
},
|
|
683
685
|
{
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
686
|
+
key: "portrait",
|
|
687
|
+
label: "顔の画像",
|
|
688
|
+
type: "media",
|
|
689
|
+
accept: ["image"]
|
|
688
690
|
}
|
|
689
691
|
],
|
|
690
|
-
|
|
692
|
+
pages: [{ path: "/authors/{id}" }]
|
|
691
693
|
},
|
|
692
694
|
{
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
695
|
+
id: "tag",
|
|
696
|
+
label: "タグ",
|
|
697
|
+
roles: { title: "label" },
|
|
698
|
+
fields: [{
|
|
699
|
+
key: "label",
|
|
700
|
+
label: "名前",
|
|
701
|
+
type: "text",
|
|
702
|
+
required: "save"
|
|
701
703
|
}]
|
|
702
704
|
},
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
"label": "画像",
|
|
706
|
-
"description": "見せたい点(hotspot)と切り抜き(crop)を画像ごとに1つ保持、切り抜く場所すべてで共通",
|
|
707
|
-
"fields": [
|
|
708
|
-
{
|
|
709
|
-
"key": "mime_type",
|
|
710
|
-
"label": "形式",
|
|
711
|
-
"type": "text",
|
|
712
|
-
"required": "save",
|
|
713
|
-
"description": "MIME タイプ"
|
|
714
|
-
},
|
|
715
|
-
{
|
|
716
|
-
"key": "size",
|
|
717
|
-
"label": "サイズ",
|
|
718
|
-
"type": "number",
|
|
719
|
-
"required": "save",
|
|
720
|
-
"description": "バイト数"
|
|
721
|
-
},
|
|
722
|
-
{
|
|
723
|
-
"key": "width",
|
|
724
|
-
"label": "幅",
|
|
725
|
-
"type": "number",
|
|
726
|
-
"required": "save",
|
|
727
|
-
"description": "px"
|
|
728
|
-
},
|
|
729
|
-
{
|
|
730
|
-
"key": "height",
|
|
731
|
-
"label": "高さ",
|
|
732
|
-
"type": "number",
|
|
733
|
-
"required": "save",
|
|
734
|
-
"description": "px"
|
|
735
|
-
},
|
|
736
|
-
{
|
|
737
|
-
"key": "alt",
|
|
738
|
-
"label": "代替テキスト",
|
|
739
|
-
"type": "text",
|
|
740
|
-
"description": "使用する側の既定の値、使用する場所ごとに上書き可"
|
|
741
|
-
}
|
|
742
|
-
]
|
|
743
|
-
},
|
|
744
|
-
{
|
|
745
|
-
"id": "video",
|
|
746
|
-
"label": "動画",
|
|
747
|
-
"fields": [
|
|
748
|
-
{
|
|
749
|
-
"key": "mime_type",
|
|
750
|
-
"label": "形式",
|
|
751
|
-
"type": "text",
|
|
752
|
-
"required": "save",
|
|
753
|
-
"description": "MIME タイプ"
|
|
754
|
-
},
|
|
755
|
-
{
|
|
756
|
-
"key": "size",
|
|
757
|
-
"label": "サイズ",
|
|
758
|
-
"type": "number",
|
|
759
|
-
"required": "save",
|
|
760
|
-
"description": "バイト数"
|
|
761
|
-
},
|
|
762
|
-
{
|
|
763
|
-
"key": "width",
|
|
764
|
-
"label": "幅",
|
|
765
|
-
"type": "number",
|
|
766
|
-
"required": "save",
|
|
767
|
-
"description": "px"
|
|
768
|
-
},
|
|
769
|
-
{
|
|
770
|
-
"key": "height",
|
|
771
|
-
"label": "高さ",
|
|
772
|
-
"type": "number",
|
|
773
|
-
"required": "save",
|
|
774
|
-
"description": "px"
|
|
775
|
-
},
|
|
776
|
-
{
|
|
777
|
-
"key": "alt",
|
|
778
|
-
"label": "代替テキスト",
|
|
779
|
-
"type": "text",
|
|
780
|
-
"description": "使用する側の既定の値、使用する場所ごとに上書き可"
|
|
781
|
-
},
|
|
782
|
-
{
|
|
783
|
-
"key": "duration",
|
|
784
|
-
"label": "長さ",
|
|
785
|
-
"type": "number",
|
|
786
|
-
"description": "秒"
|
|
787
|
-
},
|
|
788
|
-
{
|
|
789
|
-
"key": "poster",
|
|
790
|
-
"label": "ポスター画像",
|
|
791
|
-
"type": "media",
|
|
792
|
-
"accept": ["image"],
|
|
793
|
-
"description": "読み込み前・動きを抑える設定・OG で代わりに表示"
|
|
794
|
-
}
|
|
795
|
-
]
|
|
796
|
-
}
|
|
705
|
+
IMAGE_TYPE,
|
|
706
|
+
VIDEO_TYPE
|
|
797
707
|
] };
|
|
798
708
|
/** 既定の画面設定(新しい媒体の作成で適用する中立の値、移入する screens の土台) */
|
|
799
709
|
const DEFAULT_SCREENS = {
|
|
800
|
-
|
|
710
|
+
menu: [
|
|
801
711
|
"dashboard",
|
|
802
712
|
"calendar",
|
|
803
713
|
{
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
714
|
+
id: "content",
|
|
715
|
+
label: "コンテンツ",
|
|
716
|
+
items: [typeItem("post"), "media"]
|
|
807
717
|
},
|
|
808
718
|
{
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
719
|
+
id: "masters",
|
|
720
|
+
label: "マスタ",
|
|
721
|
+
items: [typeItem("tag"), typeItem("author")]
|
|
812
722
|
}
|
|
813
723
|
],
|
|
814
|
-
|
|
724
|
+
editors: { post: { sections: [
|
|
815
725
|
{
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
726
|
+
id: "classify",
|
|
727
|
+
label: "分類",
|
|
728
|
+
items: ["writers", "tags"]
|
|
819
729
|
},
|
|
820
730
|
{
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
731
|
+
id: "publish",
|
|
732
|
+
label: "公開",
|
|
733
|
+
items: ["published_at", "revised_at"]
|
|
824
734
|
},
|
|
825
735
|
{
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
736
|
+
id: "excerpt",
|
|
737
|
+
label: "説明",
|
|
738
|
+
items: ["excerpt"]
|
|
829
739
|
},
|
|
830
740
|
{
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
741
|
+
id: "image",
|
|
742
|
+
label: "メインの画像",
|
|
743
|
+
items: ["image"]
|
|
834
744
|
}
|
|
835
745
|
] } },
|
|
836
|
-
|
|
746
|
+
columns: { post: [
|
|
837
747
|
"status",
|
|
838
748
|
"writers",
|
|
839
749
|
"assignee",
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { Mark, TextStyle } from './types.js';
|
|
2
|
+
/** 装飾の順序(外側から内側、Markdown と HTML の入れ子の順) */
|
|
3
|
+
export declare const MARK_ORDER: readonly ["strong", "em", "strike", "underline", "mark", "sup", "sub", "code"];
|
|
4
|
+
/** 装飾を MARK_ORDER の順に並べる(重複は1つ) */
|
|
5
|
+
export declare const sortMarks: (marks: readonly Mark[] | undefined) => Mark[];
|
|
6
|
+
/** 装飾の描画の HTML の要素 */
|
|
7
|
+
export declare const MARK_HTML_TAGS: {
|
|
8
|
+
readonly strong: "strong";
|
|
9
|
+
readonly em: "em";
|
|
10
|
+
readonly code: "code";
|
|
11
|
+
readonly strike: "s";
|
|
12
|
+
readonly mark: "mark";
|
|
13
|
+
readonly sup: "sup";
|
|
14
|
+
readonly sub: "sub";
|
|
15
|
+
readonly underline: "u";
|
|
16
|
+
};
|
|
17
|
+
/** HTML の要素の装飾(描画の要素と、リッチエディタが使うほかの要素) */
|
|
18
|
+
export declare const HTML_TAG_MARKS: Readonly<Record<string, Mark>>;
|
|
19
|
+
/** 内側の見た目に外側の見た目を重ねる(内側を優先、名前のついた装飾は合わせる) */
|
|
20
|
+
export declare const mergeStyle: (outer: TextStyle | undefined, inner: TextStyle | undefined) => TextStyle | undefined;
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import { type Body, type
|
|
2
|
-
/** 装飾の順序(Markdown では外側から内側) */
|
|
3
|
-
export declare const MARK_ORDER: readonly Mark[];
|
|
1
|
+
import { type Body, type Rich } from './types.js';
|
|
4
2
|
/** インラインの断片の列を正規化 */
|
|
5
3
|
export declare function normalizeRich(rich: Rich): Rich;
|
|
6
4
|
/** 本文を正規化 */
|
|
@@ -60,6 +60,22 @@ export type Asset = ImageAsset | VideoAsset | FileAsset;
|
|
|
60
60
|
export type AssetRef = Readonly<{
|
|
61
61
|
asset: string;
|
|
62
62
|
}>;
|
|
63
|
+
/** 配信 API が解決した実体(url は配信 URL で配信のオリジンがある CMS だけ、hotspot・crop は元の画像に対する割合) */
|
|
64
|
+
export type DeliveredAsset = Readonly<{
|
|
65
|
+
id: string;
|
|
66
|
+
kind: 'image' | 'video' | 'file';
|
|
67
|
+
url?: string;
|
|
68
|
+
width: number;
|
|
69
|
+
height: number;
|
|
70
|
+
alt: string;
|
|
71
|
+
hotspot?: Hotspot;
|
|
72
|
+
crop?: Crop;
|
|
73
|
+
poster?: DeliveredAsset | null; /** 非公開の実体(url は署名のない配信 URL、signMediaUrl で署名して渡す) */
|
|
74
|
+
visibility?: 'private'; /** ファイルの元のファイル名・形式・大きさ(バイト) */
|
|
75
|
+
name?: string;
|
|
76
|
+
mimeType?: string;
|
|
77
|
+
size?: number;
|
|
78
|
+
}>;
|
|
63
79
|
/**
|
|
64
80
|
* 表示する素材の共通の項目
|
|
65
81
|
* - src: URL(CMS の実体)か、ビルドで読み込んだ画像
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { fieldZod, jsonSchemaOf, normalizeValues, zodOf, type ValueOptions } from './input.js';
|
|
2
|
-
export { assetRefSchema, cropSchema, hotspotSchema, mediaSchema, type Asset, type AssetRef, type Crop, type Hotspot, type LocalImage, type Media } from './asset.js';
|
|
2
|
+
export { assetRefSchema, cropSchema, hotspotSchema, mediaSchema, type Asset, type AssetRef, type Crop, type DeliveredAsset, type Hotspot, type LocalImage, type Media } from './asset.js';
|
|
3
3
|
export { coverPosition, coverStart, cropRect, croppedHotspot, objectPosition, stillOf, type CropRect } from './image.js';
|
|
4
4
|
export { IMAGE_TYPE, VIDEO_TYPE } from './media.js';
|
|
5
5
|
export { IMAGE_SIZE_MAX, imageParamsOf, MEDIA_SIGNING_KEY_BLOB, mediaBlobKeyOf, mediaExtOf, mediaKindOf, mediaMimeOf, mediaPathOf, parseMediaPath, signMediaUrl, verifyMediaUrl, withImageParams, type ImageParams, type AssetKind, type MediaPath } from './mediaUrl.js';
|
|
@@ -8,7 +8,7 @@ export { dateRoleFieldsOf, primaryTypeOf, requiredPrimaryTypeOf, SOURCES_FIELD,
|
|
|
8
8
|
export { appliesTo, checkFields, fieldsFor } from './check.js';
|
|
9
9
|
export { deliveredFields, emptyValues, pickValues, referencedIds, referencesOf, valueFieldsOf } from './values.js';
|
|
10
10
|
export { entryRefsOf, type EntryRef } from './refs.js';
|
|
11
|
-
export { acceptsRole, bodyFieldsOf, computedFieldsOf, FIELD_ROLES, idInputOf, initialValueOf,
|
|
11
|
+
export { acceptsRole, bodyFieldsOf, computedFieldsOf, FIELD_ROLES, idInputOf, initialValueOf, isPublishable, isInputField, isListType, isMediaType, isSingleton, isStoredType, MEDIA_TYPE_IDS, optionLabelOf, optionsOf, publishingOf, requestReferencesOf, resolvedRolesOf, roleFieldOf, toneOf, typeOf, type ComputedKind, type FieldRole, type FieldRoles, type FieldComputed, type ContentFormat, type ContentModel, type ContentType, type FieldCondition, type FieldDef, type FieldDerive, type FieldFixedBy, type CountDef, type FieldProblem, type MediaKind, type OptionTone, type Publishing, type ReferenceRules, type SelectOption, usesReview } from './model.js';
|
|
12
12
|
export { hasPublicPage, imageFrameOf, pagePathOf, publicPathOf, withPagesFrom, type ImageFrame, type ImageFrameDef, type PageDef, type PageEntry, type PageRule } from './page.js';
|
|
13
13
|
export { schemaRulesOf, type SchemaRule } from './rules.js';
|
|
14
14
|
export { parseModel } from './schema.js';
|
|
@@ -183,7 +183,7 @@ export declare const isListType: (type: ContentType) => boolean;
|
|
|
183
183
|
* - 機能: 版・楽観ロック・編集中のリース・コメント・公開の前の点検
|
|
184
184
|
* - 提出と差し戻し・担当者: レビューありの型だけ(usesReview)
|
|
185
185
|
*/
|
|
186
|
-
export declare const
|
|
186
|
+
export declare const isPublishable: (type: ContentType) => boolean;
|
|
187
187
|
/**
|
|
188
188
|
* レビューのワークフローを持つ型か(レビューありの一覧の型)
|
|
189
189
|
* - 機能: 提出と差し戻し・担当者(レビューを担当するアカウント)
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { BodyProfile } from '../../body/src/index.js';
|
|
2
|
+
import { type ContentModel, type ScreenSettings } from '../../model/src/index.js';
|
|
3
|
+
/** 既定の本文の設定(本文の項目 profile と同じ値) */
|
|
4
|
+
export declare const DEFAULT_BODY_PROFILE: BodyProfile;
|
|
2
5
|
/** 中立の既定のスキーマ(新しい媒体の作成で適用する型: post・author・tag・image・video、設定の移入の土台) */
|
|
3
6
|
export declare const DEFAULT_SCHEMA: ContentModel;
|
|
4
7
|
/** 既定の画面設定(新しい媒体の作成で適用する中立の値、移入する screens の土台) */
|
|
@@ -2,8 +2,8 @@ export { cachedDelivery, memoryDeliveryCache, type DeliveryCache } from './cache
|
|
|
2
2
|
export { readChanges, type Change, type ChangesPage } from './changes.js';
|
|
3
3
|
export { createDeliveryClient, DELIVERY_PATH, DeliveryError, subPath, type BundleResult, type Delivery, type DeliveryClient, type Prefetched } from './client.js';
|
|
4
4
|
export { deliveredImageUrl, mediaOf, type ImageUrl, type MediaOf } from './media.js';
|
|
5
|
-
export { imageParamsOf, parseMediaPath, signMediaUrl, withImageParams, type ImageParams, type MediaPath } from '../../../model/src/index.js';
|
|
5
|
+
export { imageParamsOf, parseMediaPath, signMediaUrl, withImageParams, type DeliveredAsset, type ImageParams, type MediaPath } from '../../../model/src/index.js';
|
|
6
6
|
export type { FieldPath, Selected } from './fields.js';
|
|
7
7
|
export { listParams, type ListFilter, type ListQuery, type Page } from './query.js';
|
|
8
8
|
export { createDeliveryClock, fieldOf, limitOf, optionLabels, pagePath, type DeliveryClock } from './schema.js';
|
|
9
|
-
export type {
|
|
9
|
+
export type { FieldValue, Item, ItemMeta, ItemOf } from './values.js';
|
|
@@ -1,23 +1,7 @@
|
|
|
1
1
|
import type { Body } from '../../../body/src/index.js';
|
|
2
|
-
import type { ContentType,
|
|
2
|
+
import type { ContentType, DateString, DeliveredAsset, FieldDef } from '../../../model/src/index.js';
|
|
3
3
|
/** 配信 API の1件の値(id・項目の key・メタ情報 _meta) */
|
|
4
4
|
export type Item = Readonly<Record<string, unknown>>;
|
|
5
|
-
/** 配信 API が解決した実体(url は配信 URL で配信のオリジンがある CMS だけ、hotspot・crop は元の画像に対する割合) */
|
|
6
|
-
export type DeliveredAsset = Readonly<{
|
|
7
|
-
id: string;
|
|
8
|
-
kind: 'image' | 'video' | 'file';
|
|
9
|
-
url?: string;
|
|
10
|
-
width: number;
|
|
11
|
-
height: number;
|
|
12
|
-
alt: string;
|
|
13
|
-
hotspot?: Hotspot;
|
|
14
|
-
crop?: Crop;
|
|
15
|
-
poster?: DeliveredAsset | null; /** 非公開の実体(url は署名のない配信 URL、signMediaUrl で署名して渡す) */
|
|
16
|
-
visibility?: 'private'; /** ファイルの元のファイル名・形式・大きさ(バイト) */
|
|
17
|
-
name?: string;
|
|
18
|
-
mimeType?: string;
|
|
19
|
-
size?: number;
|
|
20
|
-
}>;
|
|
21
5
|
/** 項目の1つ分の値(複数の値を持つ項目は FieldValue が配列に、query.ts の絞り込みの値と共通) */
|
|
22
6
|
export type SingleValue<F extends FieldDef> = F extends {
|
|
23
7
|
type: 'text' | 'textarea';
|
|
@@ -2,4 +2,4 @@ export { coverPosition, coverStart, createClock, cropRect, croppedHotspot, IMAGE
|
|
|
2
2
|
export type { Asset, AssetRef, Clock, ContentModel, ContentType, Crop, CropRect, DateString, FieldDef, Hotspot, LocalImage, Media, PageDef, PageEntry, ScreenSettings } from '../../model/src/index.js';
|
|
3
3
|
export { CONFIG_FORMAT } from '../../cms-contract/src/index.js';
|
|
4
4
|
export type { ConfigBundle } from '../../cms-contract/src/index.js';
|
|
5
|
-
export { DEFAULT_SCHEMA, DEFAULT_SCREENS } from '
|
|
5
|
+
export { DEFAULT_SCHEMA, DEFAULT_SCREENS } from '../../platform/src/defaultModel.js';
|