@supernova-studio/client 0.15.0 → 0.17.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.
- package/dist/index.d.mts +35218 -4953
- package/dist/index.d.ts +35218 -4953
- package/dist/index.js +1167 -81
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1195 -109
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/api/conversion/documentation/documentation-elements-to-hierarchy-v2-dto.ts +20 -0
- package/src/api/conversion/documentation/documentation-group-to-dto.ts +83 -0
- package/src/api/conversion/documentation/documentation-page-to-dto-utils.ts +54 -0
- package/src/api/conversion/documentation/documentation-page-v1-to-dto.ts +43 -0
- package/src/api/conversion/documentation/documentation-page-v2-to-dto.ts +57 -0
- package/src/api/conversion/documentation/index.ts +5 -0
- package/src/api/conversion/index.ts +1 -0
- package/src/api/dto/{design-system.ts → design-systems/design-system.ts} +6 -2
- package/src/api/dto/design-systems/index.ts +1 -0
- package/src/api/dto/documentation/index.ts +0 -0
- package/src/api/dto/elements/documentation/group-action.ts +66 -0
- package/src/api/dto/elements/documentation/group-bulk-action.ts +32 -0
- package/src/api/dto/elements/documentation/group.ts +85 -0
- package/src/api/dto/elements/documentation/index.ts +7 -0
- package/src/api/dto/elements/documentation/page-actions-v2.ts +66 -0
- package/src/api/dto/elements/documentation/page-bulk-action-v2.ts +33 -0
- package/src/api/dto/{documentation-v1.ts → elements/documentation/page-v1.ts} +4 -0
- package/src/api/dto/elements/documentation/page-v2.ts +87 -0
- package/src/api/dto/elements/elements-action-v2.ts +61 -0
- package/src/api/dto/elements/elements-bulk-action-v2.ts +25 -0
- package/src/api/dto/elements/index.ts +3 -0
- package/src/api/dto/index.ts +2 -3
- package/src/api/index.ts +2 -2
- package/src/api/payloads/documentation/block-definitions.ts +12 -0
- package/src/api/payloads/documentation/index.ts +1 -0
- package/src/api/payloads/index.ts +2 -0
- package/src/api/payloads/liveblocks/auth.ts +7 -0
- package/src/api/payloads/liveblocks/index.ts +1 -0
- package/src/index.ts +1 -2
- package/src/yjs/design-system-content/documentation-hierarchy.ts +100 -0
- package/src/yjs/index.ts +2 -0
- package/src/api/dto/documentation-v2.ts +0 -28
- package/src/api/dto/documentation.ts +0 -29
- package/src/api/requests/elements/elements-transaction-v2.ts +0 -53
- package/src/api/requests/elements/index.ts +0 -1
- package/src/api/requests/index.ts +0 -2
- package/src/api/requests/post-liveblocks-auth.ts +0 -4
- package/src/api/responses/elements/elements-transaction-v2.ts +0 -11
- package/src/api/responses/elements/index.ts +0 -1
- package/src/api/responses/get-block-definitions.ts +0 -8
- package/src/api/responses/index.ts +0 -2
- package/src/design-system-content/documentation-hierarchy.ts +0 -74
- /package/src/{design-system-content → yjs/design-system-content}/index.ts +0 -0
- /package/src/{design-system-content → yjs/design-system-content}/item-configuration.ts +0 -0
- /package/src/{docs-editor → yjs/docs-editor}/blocks-to-prosemirror.ts +0 -0
- /package/src/{docs-editor → yjs/docs-editor}/index.ts +0 -0
- /package/src/{docs-editor → yjs/docs-editor}/mock.ts +0 -0
- /package/src/{docs-editor → yjs/docs-editor}/model/block.ts +0 -0
- /package/src/{docs-editor → yjs/docs-editor}/model/index.ts +0 -0
- /package/src/{docs-editor → yjs/docs-editor}/model/page.ts +0 -0
- /package/src/{docs-editor → yjs/docs-editor}/prosemirror/index.ts +0 -0
- /package/src/{docs-editor → yjs/docs-editor}/prosemirror/schema.ts +0 -0
- /package/src/{docs-editor → yjs/docs-editor}/prosemirror/types.ts +0 -0
- /package/src/{docs-editor → yjs/docs-editor}/prosemirror-to-blocks.ts +0 -0
- /package/src/{docs-editor → yjs/docs-editor}/utils.ts +0 -0
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }// ../model/dist/index.mjs
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }// ../model/dist/index.mjs
|
|
2
2
|
var _zod = require('zod');
|
|
3
3
|
|
|
4
4
|
|
|
@@ -126,6 +126,7 @@ var _zod = require('zod');
|
|
|
126
126
|
|
|
127
127
|
|
|
128
128
|
|
|
129
|
+
var _slugify = require('@sindresorhus/slugify'); var _slugify2 = _interopRequireDefault(_slugify);
|
|
129
130
|
var PluginOAuthRequestSchema = _zod.z.object({
|
|
130
131
|
id: _zod.z.string(),
|
|
131
132
|
codeChallenge: _zod.z.string(),
|
|
@@ -2605,6 +2606,16 @@ var DesignSystemVersionRoom = Entity.extend({
|
|
|
2605
2606
|
designSystemVersionId: _zod.z.string(),
|
|
2606
2607
|
liveblocksId: _zod.z.string()
|
|
2607
2608
|
});
|
|
2609
|
+
var DesignSystemVersionRoomInitialState = _zod.z.object({
|
|
2610
|
+
pages: _zod.z.array(DocumentationPageV2),
|
|
2611
|
+
groups: _zod.z.array(ElementGroup),
|
|
2612
|
+
deletedPagePersistentIds: _zod.z.array(_zod.z.string()),
|
|
2613
|
+
deletedGroupPersistentIds: _zod.z.array(_zod.z.string())
|
|
2614
|
+
});
|
|
2615
|
+
var DesignSystemVersionRoomUpdate = DesignSystemVersionRoomInitialState.extend({
|
|
2616
|
+
deletedPagePersistentIds: _zod.z.array(_zod.z.string()),
|
|
2617
|
+
deletedGroupPersistentIds: _zod.z.array(_zod.z.string())
|
|
2618
|
+
});
|
|
2608
2619
|
var DocumentationPageRoom = Entity.extend({
|
|
2609
2620
|
designSystemVersionId: _zod.z.string(),
|
|
2610
2621
|
documentationPageId: _zod.z.string(),
|
|
@@ -2653,6 +2664,86 @@ var PersonalAccessToken = _zod.z.object({
|
|
|
2653
2664
|
expireAt: _zod.z.date().optional(),
|
|
2654
2665
|
scope: _zod.z.string().optional()
|
|
2655
2666
|
});
|
|
2667
|
+
var SupernovaException = class _SupernovaException extends Error {
|
|
2668
|
+
//
|
|
2669
|
+
// Properties
|
|
2670
|
+
//
|
|
2671
|
+
constructor(type, message) {
|
|
2672
|
+
super(`${type}: ${message}`);
|
|
2673
|
+
this.type = type;
|
|
2674
|
+
}
|
|
2675
|
+
static wrongFormat(message) {
|
|
2676
|
+
return new _SupernovaException("WrongFormat", message);
|
|
2677
|
+
}
|
|
2678
|
+
static accessDenied(message) {
|
|
2679
|
+
return new _SupernovaException("AccessDenied", message);
|
|
2680
|
+
}
|
|
2681
|
+
static notFound(message) {
|
|
2682
|
+
return new _SupernovaException("ResourceNotFound", message);
|
|
2683
|
+
}
|
|
2684
|
+
static timeout(message) {
|
|
2685
|
+
return new _SupernovaException("Timeout", message);
|
|
2686
|
+
}
|
|
2687
|
+
static conflict(message) {
|
|
2688
|
+
return new _SupernovaException("Conflict", message);
|
|
2689
|
+
}
|
|
2690
|
+
static notImplemented(message) {
|
|
2691
|
+
return new _SupernovaException("NotImplemented", message);
|
|
2692
|
+
}
|
|
2693
|
+
static wrongActionOrder(message) {
|
|
2694
|
+
return new _SupernovaException("WrongActionOrder", message);
|
|
2695
|
+
}
|
|
2696
|
+
static invalidOperation(message) {
|
|
2697
|
+
return new _SupernovaException("InvalidOperation", message);
|
|
2698
|
+
}
|
|
2699
|
+
static shouldNotHappen(message) {
|
|
2700
|
+
return new _SupernovaException("UnexpectedError", message);
|
|
2701
|
+
}
|
|
2702
|
+
static ipRestricted(message) {
|
|
2703
|
+
return new _SupernovaException("IPRestricted", message);
|
|
2704
|
+
}
|
|
2705
|
+
static planRestricted(message) {
|
|
2706
|
+
return new _SupernovaException("PlanRestricted", message);
|
|
2707
|
+
}
|
|
2708
|
+
static missingWorkspacePermission(message) {
|
|
2709
|
+
return new _SupernovaException("MissingWorkspacePermission", message);
|
|
2710
|
+
}
|
|
2711
|
+
static missingExporterPermission(message) {
|
|
2712
|
+
return new _SupernovaException("MissingExporterPermission", message);
|
|
2713
|
+
}
|
|
2714
|
+
static missingIntegration(message) {
|
|
2715
|
+
return new _SupernovaException("AccessDenied", message);
|
|
2716
|
+
}
|
|
2717
|
+
static noAccess(message) {
|
|
2718
|
+
return new _SupernovaException("NoAccess", message);
|
|
2719
|
+
}
|
|
2720
|
+
//
|
|
2721
|
+
// To refactor
|
|
2722
|
+
//
|
|
2723
|
+
static badRequest(message) {
|
|
2724
|
+
return new _SupernovaException("BadRequest", message);
|
|
2725
|
+
}
|
|
2726
|
+
};
|
|
2727
|
+
function mapByUnique(items, keyFn) {
|
|
2728
|
+
const result = /* @__PURE__ */ new Map();
|
|
2729
|
+
for (const item of items) {
|
|
2730
|
+
result.set(keyFn(item), item);
|
|
2731
|
+
}
|
|
2732
|
+
return result;
|
|
2733
|
+
}
|
|
2734
|
+
function groupBy(items, keyFn) {
|
|
2735
|
+
const result = /* @__PURE__ */ new Map();
|
|
2736
|
+
for (const item of items) {
|
|
2737
|
+
const key = keyFn(item);
|
|
2738
|
+
const array = result.get(key);
|
|
2739
|
+
if (array) {
|
|
2740
|
+
array.push(item);
|
|
2741
|
+
} else {
|
|
2742
|
+
result.set(key, [item]);
|
|
2743
|
+
}
|
|
2744
|
+
}
|
|
2745
|
+
return result;
|
|
2746
|
+
}
|
|
2656
2747
|
var ContentLoadInstruction = _zod.z.object({
|
|
2657
2748
|
from: _zod.z.string(),
|
|
2658
2749
|
to: _zod.z.string(),
|
|
@@ -2674,33 +2765,803 @@ var ContentLoaderPayload = _zod.z.object({
|
|
|
2674
2765
|
location: _zod.z.string()
|
|
2675
2766
|
})
|
|
2676
2767
|
);
|
|
2768
|
+
function slugify(str, options) {
|
|
2769
|
+
const slug = _slugify2.default.call(void 0, _nullishCoalesce(str, () => ( "")), options);
|
|
2770
|
+
return _optionalChain([slug, 'optionalAccess', _2 => _2.length]) > 0 ? slug : "item";
|
|
2771
|
+
}
|
|
2772
|
+
var RESERVED_SLUGS = [
|
|
2773
|
+
"workspaces",
|
|
2774
|
+
"workspace",
|
|
2775
|
+
"api0",
|
|
2776
|
+
"api1",
|
|
2777
|
+
"api2",
|
|
2778
|
+
"custom",
|
|
2779
|
+
"x-sn-reserved",
|
|
2780
|
+
// further elements copied from https://github.com/shouldbee/reserved-usernames/blob/master/reserved-usernames.json
|
|
2781
|
+
"0",
|
|
2782
|
+
"about",
|
|
2783
|
+
"access",
|
|
2784
|
+
"account",
|
|
2785
|
+
"accounts",
|
|
2786
|
+
"activate",
|
|
2787
|
+
"activities",
|
|
2788
|
+
"activity",
|
|
2789
|
+
"ad",
|
|
2790
|
+
"add",
|
|
2791
|
+
"address",
|
|
2792
|
+
"adm",
|
|
2793
|
+
"admin",
|
|
2794
|
+
"administration",
|
|
2795
|
+
"administrator",
|
|
2796
|
+
"ads",
|
|
2797
|
+
"adult",
|
|
2798
|
+
"advertising",
|
|
2799
|
+
"affiliate",
|
|
2800
|
+
"affiliates",
|
|
2801
|
+
"ajax",
|
|
2802
|
+
"all",
|
|
2803
|
+
"alpha",
|
|
2804
|
+
"analysis",
|
|
2805
|
+
"analytics",
|
|
2806
|
+
"android",
|
|
2807
|
+
"anon",
|
|
2808
|
+
"anonymous",
|
|
2809
|
+
"api",
|
|
2810
|
+
"app",
|
|
2811
|
+
"apps",
|
|
2812
|
+
"archive",
|
|
2813
|
+
"archives",
|
|
2814
|
+
"article",
|
|
2815
|
+
"asct",
|
|
2816
|
+
"asset",
|
|
2817
|
+
"assets",
|
|
2818
|
+
"atom",
|
|
2819
|
+
"auth",
|
|
2820
|
+
"authentication",
|
|
2821
|
+
"avatar",
|
|
2822
|
+
"backup",
|
|
2823
|
+
"balancer-manager",
|
|
2824
|
+
"banner",
|
|
2825
|
+
"banners",
|
|
2826
|
+
"beta",
|
|
2827
|
+
"billing",
|
|
2828
|
+
"bin",
|
|
2829
|
+
"blog",
|
|
2830
|
+
"blogs",
|
|
2831
|
+
"board",
|
|
2832
|
+
"book",
|
|
2833
|
+
"bookmark",
|
|
2834
|
+
"bot",
|
|
2835
|
+
"bots",
|
|
2836
|
+
"bug",
|
|
2837
|
+
"business",
|
|
2838
|
+
"cache",
|
|
2839
|
+
"cadastro",
|
|
2840
|
+
"calendar",
|
|
2841
|
+
"call",
|
|
2842
|
+
"campaign",
|
|
2843
|
+
"cancel",
|
|
2844
|
+
"captcha",
|
|
2845
|
+
"career",
|
|
2846
|
+
"careers",
|
|
2847
|
+
"cart",
|
|
2848
|
+
"categories",
|
|
2849
|
+
"category",
|
|
2850
|
+
"cgi",
|
|
2851
|
+
"cgi-bin",
|
|
2852
|
+
"changelog",
|
|
2853
|
+
"chat",
|
|
2854
|
+
"check",
|
|
2855
|
+
"checking",
|
|
2856
|
+
"checkout",
|
|
2857
|
+
"client",
|
|
2858
|
+
"cliente",
|
|
2859
|
+
"clients",
|
|
2860
|
+
"code",
|
|
2861
|
+
"codereview",
|
|
2862
|
+
"comercial",
|
|
2863
|
+
"comment",
|
|
2864
|
+
"comments",
|
|
2865
|
+
"communities",
|
|
2866
|
+
"community",
|
|
2867
|
+
"company",
|
|
2868
|
+
"compare",
|
|
2869
|
+
"compras",
|
|
2870
|
+
"config",
|
|
2871
|
+
"configuration",
|
|
2872
|
+
"connect",
|
|
2873
|
+
"contact",
|
|
2874
|
+
"contact-us",
|
|
2875
|
+
"contact_us",
|
|
2876
|
+
"contactus",
|
|
2877
|
+
"contest",
|
|
2878
|
+
"contribute",
|
|
2879
|
+
"corp",
|
|
2880
|
+
"create",
|
|
2881
|
+
"css",
|
|
2882
|
+
"dashboard",
|
|
2883
|
+
"data",
|
|
2884
|
+
"db",
|
|
2885
|
+
"default",
|
|
2886
|
+
"delete",
|
|
2887
|
+
"demo",
|
|
2888
|
+
"design",
|
|
2889
|
+
"designer",
|
|
2890
|
+
"destroy",
|
|
2891
|
+
"dev",
|
|
2892
|
+
"devel",
|
|
2893
|
+
"developer",
|
|
2894
|
+
"developers",
|
|
2895
|
+
"diagram",
|
|
2896
|
+
"diary",
|
|
2897
|
+
"dict",
|
|
2898
|
+
"dictionary",
|
|
2899
|
+
"die",
|
|
2900
|
+
"dir",
|
|
2901
|
+
"direct_messages",
|
|
2902
|
+
"directory",
|
|
2903
|
+
"dist",
|
|
2904
|
+
"doc",
|
|
2905
|
+
"docs",
|
|
2906
|
+
"documentation",
|
|
2907
|
+
"domain",
|
|
2908
|
+
"download",
|
|
2909
|
+
"downloads",
|
|
2910
|
+
"ecommerce",
|
|
2911
|
+
"edit",
|
|
2912
|
+
"editor",
|
|
2913
|
+
"edu",
|
|
2914
|
+
"education",
|
|
2915
|
+
"email",
|
|
2916
|
+
"employment",
|
|
2917
|
+
"empty",
|
|
2918
|
+
"end",
|
|
2919
|
+
"enterprise",
|
|
2920
|
+
"entries",
|
|
2921
|
+
"entry",
|
|
2922
|
+
"error",
|
|
2923
|
+
"errors",
|
|
2924
|
+
"eval",
|
|
2925
|
+
"event",
|
|
2926
|
+
"exit",
|
|
2927
|
+
"explore",
|
|
2928
|
+
"facebook",
|
|
2929
|
+
"faq",
|
|
2930
|
+
"favorite",
|
|
2931
|
+
"favorites",
|
|
2932
|
+
"feature",
|
|
2933
|
+
"features",
|
|
2934
|
+
"feed",
|
|
2935
|
+
"feedback",
|
|
2936
|
+
"feeds",
|
|
2937
|
+
"file",
|
|
2938
|
+
"files",
|
|
2939
|
+
"first",
|
|
2940
|
+
"flash",
|
|
2941
|
+
"fleet",
|
|
2942
|
+
"fleets",
|
|
2943
|
+
"flog",
|
|
2944
|
+
"follow",
|
|
2945
|
+
"followers",
|
|
2946
|
+
"following",
|
|
2947
|
+
"forgot",
|
|
2948
|
+
"form",
|
|
2949
|
+
"forum",
|
|
2950
|
+
"forums",
|
|
2951
|
+
"founder",
|
|
2952
|
+
"free",
|
|
2953
|
+
"friend",
|
|
2954
|
+
"friends",
|
|
2955
|
+
"ftp",
|
|
2956
|
+
"gadget",
|
|
2957
|
+
"gadgets",
|
|
2958
|
+
"game",
|
|
2959
|
+
"games",
|
|
2960
|
+
"get",
|
|
2961
|
+
"ghost",
|
|
2962
|
+
"gift",
|
|
2963
|
+
"gifts",
|
|
2964
|
+
"gist",
|
|
2965
|
+
"github",
|
|
2966
|
+
"graph",
|
|
2967
|
+
"group",
|
|
2968
|
+
"groups",
|
|
2969
|
+
"guest",
|
|
2970
|
+
"guests",
|
|
2971
|
+
"help",
|
|
2972
|
+
"home",
|
|
2973
|
+
"homepage",
|
|
2974
|
+
"host",
|
|
2975
|
+
"hosting",
|
|
2976
|
+
"hostmaster",
|
|
2977
|
+
"hostname",
|
|
2978
|
+
"howto",
|
|
2979
|
+
"hpg",
|
|
2980
|
+
"html",
|
|
2981
|
+
"http",
|
|
2982
|
+
"httpd",
|
|
2983
|
+
"https",
|
|
2984
|
+
"i",
|
|
2985
|
+
"iamges",
|
|
2986
|
+
"icon",
|
|
2987
|
+
"icons",
|
|
2988
|
+
"id",
|
|
2989
|
+
"idea",
|
|
2990
|
+
"ideas",
|
|
2991
|
+
"image",
|
|
2992
|
+
"images",
|
|
2993
|
+
"imap",
|
|
2994
|
+
"img",
|
|
2995
|
+
"index",
|
|
2996
|
+
"indice",
|
|
2997
|
+
"info",
|
|
2998
|
+
"information",
|
|
2999
|
+
"inquiry",
|
|
3000
|
+
"instagram",
|
|
3001
|
+
"intranet",
|
|
3002
|
+
"invitations",
|
|
3003
|
+
"invite",
|
|
3004
|
+
"ipad",
|
|
3005
|
+
"iphone",
|
|
3006
|
+
"irc",
|
|
3007
|
+
"is",
|
|
3008
|
+
"issue",
|
|
3009
|
+
"issues",
|
|
3010
|
+
"it",
|
|
3011
|
+
"item",
|
|
3012
|
+
"items",
|
|
3013
|
+
"java",
|
|
3014
|
+
"javascript",
|
|
3015
|
+
"job",
|
|
3016
|
+
"jobs",
|
|
3017
|
+
"join",
|
|
3018
|
+
"js",
|
|
3019
|
+
"json",
|
|
3020
|
+
"jump",
|
|
3021
|
+
"knowledgebase",
|
|
3022
|
+
"language",
|
|
3023
|
+
"languages",
|
|
3024
|
+
"last",
|
|
3025
|
+
"ldap-status",
|
|
3026
|
+
"legal",
|
|
3027
|
+
"license",
|
|
3028
|
+
"link",
|
|
3029
|
+
"links",
|
|
3030
|
+
"linux",
|
|
3031
|
+
"list",
|
|
3032
|
+
"lists",
|
|
3033
|
+
"log",
|
|
3034
|
+
"log-in",
|
|
3035
|
+
"log-out",
|
|
3036
|
+
"log_in",
|
|
3037
|
+
"log_out",
|
|
3038
|
+
"login",
|
|
3039
|
+
"logout",
|
|
3040
|
+
"logs",
|
|
3041
|
+
"m",
|
|
3042
|
+
"mac",
|
|
3043
|
+
"mail",
|
|
3044
|
+
"mail1",
|
|
3045
|
+
"mail2",
|
|
3046
|
+
"mail3",
|
|
3047
|
+
"mail4",
|
|
3048
|
+
"mail5",
|
|
3049
|
+
"mailer",
|
|
3050
|
+
"mailing",
|
|
3051
|
+
"maintenance",
|
|
3052
|
+
"manager",
|
|
3053
|
+
"manual",
|
|
3054
|
+
"map",
|
|
3055
|
+
"maps",
|
|
3056
|
+
"marketing",
|
|
3057
|
+
"master",
|
|
3058
|
+
"me",
|
|
3059
|
+
"media",
|
|
3060
|
+
"member",
|
|
3061
|
+
"members",
|
|
3062
|
+
"message",
|
|
3063
|
+
"messages",
|
|
3064
|
+
"messenger",
|
|
3065
|
+
"microblog",
|
|
3066
|
+
"microblogs",
|
|
3067
|
+
"mine",
|
|
3068
|
+
"mis",
|
|
3069
|
+
"mob",
|
|
3070
|
+
"mobile",
|
|
3071
|
+
"movie",
|
|
3072
|
+
"movies",
|
|
3073
|
+
"mp3",
|
|
3074
|
+
"msg",
|
|
3075
|
+
"msn",
|
|
3076
|
+
"music",
|
|
3077
|
+
"musicas",
|
|
3078
|
+
"mx",
|
|
3079
|
+
"my",
|
|
3080
|
+
"mysql",
|
|
3081
|
+
"name",
|
|
3082
|
+
"named",
|
|
3083
|
+
"nan",
|
|
3084
|
+
"navi",
|
|
3085
|
+
"navigation",
|
|
3086
|
+
"net",
|
|
3087
|
+
"network",
|
|
3088
|
+
"new",
|
|
3089
|
+
"news",
|
|
3090
|
+
"newsletter",
|
|
3091
|
+
"nick",
|
|
3092
|
+
"nickname",
|
|
3093
|
+
"notes",
|
|
3094
|
+
"noticias",
|
|
3095
|
+
"notification",
|
|
3096
|
+
"notifications",
|
|
3097
|
+
"notify",
|
|
3098
|
+
"ns",
|
|
3099
|
+
"ns1",
|
|
3100
|
+
"ns10",
|
|
3101
|
+
"ns2",
|
|
3102
|
+
"ns3",
|
|
3103
|
+
"ns4",
|
|
3104
|
+
"ns5",
|
|
3105
|
+
"ns6",
|
|
3106
|
+
"ns7",
|
|
3107
|
+
"ns8",
|
|
3108
|
+
"ns9",
|
|
3109
|
+
"null",
|
|
3110
|
+
"oauth",
|
|
3111
|
+
"oauth_clients",
|
|
3112
|
+
"offer",
|
|
3113
|
+
"offers",
|
|
3114
|
+
"official",
|
|
3115
|
+
"old",
|
|
3116
|
+
"online",
|
|
3117
|
+
"openid",
|
|
3118
|
+
"operator",
|
|
3119
|
+
"order",
|
|
3120
|
+
"orders",
|
|
3121
|
+
"organization",
|
|
3122
|
+
"organizations",
|
|
3123
|
+
"overview",
|
|
3124
|
+
"owner",
|
|
3125
|
+
"owners",
|
|
3126
|
+
"page",
|
|
3127
|
+
"pager",
|
|
3128
|
+
"pages",
|
|
3129
|
+
"panel",
|
|
3130
|
+
"password",
|
|
3131
|
+
"payment",
|
|
3132
|
+
"perl",
|
|
3133
|
+
"phone",
|
|
3134
|
+
"photo",
|
|
3135
|
+
"photoalbum",
|
|
3136
|
+
"photos",
|
|
3137
|
+
"php",
|
|
3138
|
+
"phpmyadmin",
|
|
3139
|
+
"phppgadmin",
|
|
3140
|
+
"phpredisadmin",
|
|
3141
|
+
"pic",
|
|
3142
|
+
"pics",
|
|
3143
|
+
"ping",
|
|
3144
|
+
"plan",
|
|
3145
|
+
"plans",
|
|
3146
|
+
"plugin",
|
|
3147
|
+
"plugins",
|
|
3148
|
+
"policy",
|
|
3149
|
+
"pop",
|
|
3150
|
+
"pop3",
|
|
3151
|
+
"popular",
|
|
3152
|
+
"portal",
|
|
3153
|
+
"post",
|
|
3154
|
+
"postfix",
|
|
3155
|
+
"postmaster",
|
|
3156
|
+
"posts",
|
|
3157
|
+
"pr",
|
|
3158
|
+
"premium",
|
|
3159
|
+
"press",
|
|
3160
|
+
"price",
|
|
3161
|
+
"pricing",
|
|
3162
|
+
"privacy",
|
|
3163
|
+
"privacy-policy",
|
|
3164
|
+
"privacy_policy",
|
|
3165
|
+
"privacypolicy",
|
|
3166
|
+
"private",
|
|
3167
|
+
"product",
|
|
3168
|
+
"products",
|
|
3169
|
+
"profile",
|
|
3170
|
+
"project",
|
|
3171
|
+
"projects",
|
|
3172
|
+
"promo",
|
|
3173
|
+
"pub",
|
|
3174
|
+
"public",
|
|
3175
|
+
"purpose",
|
|
3176
|
+
"put",
|
|
3177
|
+
"python",
|
|
3178
|
+
"query",
|
|
3179
|
+
"random",
|
|
3180
|
+
"ranking",
|
|
3181
|
+
"read",
|
|
3182
|
+
"readme",
|
|
3183
|
+
"recent",
|
|
3184
|
+
"recruit",
|
|
3185
|
+
"recruitment",
|
|
3186
|
+
"register",
|
|
3187
|
+
"registration",
|
|
3188
|
+
"release",
|
|
3189
|
+
"remove",
|
|
3190
|
+
"replies",
|
|
3191
|
+
"report",
|
|
3192
|
+
"reports",
|
|
3193
|
+
"repositories",
|
|
3194
|
+
"repository",
|
|
3195
|
+
"req",
|
|
3196
|
+
"request",
|
|
3197
|
+
"requests",
|
|
3198
|
+
"reset",
|
|
3199
|
+
"roc",
|
|
3200
|
+
"root",
|
|
3201
|
+
"rss",
|
|
3202
|
+
"ruby",
|
|
3203
|
+
"rule",
|
|
3204
|
+
"sag",
|
|
3205
|
+
"sale",
|
|
3206
|
+
"sales",
|
|
3207
|
+
"sample",
|
|
3208
|
+
"samples",
|
|
3209
|
+
"save",
|
|
3210
|
+
"school",
|
|
3211
|
+
"script",
|
|
3212
|
+
"scripts",
|
|
3213
|
+
"search",
|
|
3214
|
+
"secure",
|
|
3215
|
+
"security",
|
|
3216
|
+
"self",
|
|
3217
|
+
"send",
|
|
3218
|
+
"server",
|
|
3219
|
+
"server-info",
|
|
3220
|
+
"server-status",
|
|
3221
|
+
"service",
|
|
3222
|
+
"services",
|
|
3223
|
+
"session",
|
|
3224
|
+
"sessions",
|
|
3225
|
+
"setting",
|
|
3226
|
+
"settings",
|
|
3227
|
+
"setup",
|
|
3228
|
+
"share",
|
|
3229
|
+
"shop",
|
|
3230
|
+
"show",
|
|
3231
|
+
"sign-in",
|
|
3232
|
+
"sign-up",
|
|
3233
|
+
"sign_in",
|
|
3234
|
+
"sign_up",
|
|
3235
|
+
"signin",
|
|
3236
|
+
"signout",
|
|
3237
|
+
"signup",
|
|
3238
|
+
"site",
|
|
3239
|
+
"sitemap",
|
|
3240
|
+
"sites",
|
|
3241
|
+
"smartphone",
|
|
3242
|
+
"smtp",
|
|
3243
|
+
"soporte",
|
|
3244
|
+
"source",
|
|
3245
|
+
"spec",
|
|
3246
|
+
"special",
|
|
3247
|
+
"sql",
|
|
3248
|
+
"src",
|
|
3249
|
+
"ssh",
|
|
3250
|
+
"ssl",
|
|
3251
|
+
"ssladmin",
|
|
3252
|
+
"ssladministrator",
|
|
3253
|
+
"sslwebmaster",
|
|
3254
|
+
"staff",
|
|
3255
|
+
"stage",
|
|
3256
|
+
"staging",
|
|
3257
|
+
"start",
|
|
3258
|
+
"stat",
|
|
3259
|
+
"state",
|
|
3260
|
+
"static",
|
|
3261
|
+
"stats",
|
|
3262
|
+
"status",
|
|
3263
|
+
"store",
|
|
3264
|
+
"stores",
|
|
3265
|
+
"stories",
|
|
3266
|
+
"style",
|
|
3267
|
+
"styleguide",
|
|
3268
|
+
"stylesheet",
|
|
3269
|
+
"stylesheets",
|
|
3270
|
+
"subdomain",
|
|
3271
|
+
"subscribe",
|
|
3272
|
+
"subscriptions",
|
|
3273
|
+
"suporte",
|
|
3274
|
+
"support",
|
|
3275
|
+
"svn",
|
|
3276
|
+
"swf",
|
|
3277
|
+
"sys",
|
|
3278
|
+
"sysadmin",
|
|
3279
|
+
"sysadministrator",
|
|
3280
|
+
"system",
|
|
3281
|
+
"tablet",
|
|
3282
|
+
"tablets",
|
|
3283
|
+
"tag",
|
|
3284
|
+
"talk",
|
|
3285
|
+
"task",
|
|
3286
|
+
"tasks",
|
|
3287
|
+
"team",
|
|
3288
|
+
"teams",
|
|
3289
|
+
"tech",
|
|
3290
|
+
"telnet",
|
|
3291
|
+
"term",
|
|
3292
|
+
"terms",
|
|
3293
|
+
"terms-of-service",
|
|
3294
|
+
"terms_of_service",
|
|
3295
|
+
"termsofservice",
|
|
3296
|
+
"test",
|
|
3297
|
+
"test1",
|
|
3298
|
+
"test2",
|
|
3299
|
+
"test3",
|
|
3300
|
+
"teste",
|
|
3301
|
+
"testing",
|
|
3302
|
+
"tests",
|
|
3303
|
+
"theme",
|
|
3304
|
+
"themes",
|
|
3305
|
+
"thread",
|
|
3306
|
+
"threads",
|
|
3307
|
+
"tmp",
|
|
3308
|
+
"todo",
|
|
3309
|
+
"tool",
|
|
3310
|
+
"tools",
|
|
3311
|
+
"top",
|
|
3312
|
+
"topic",
|
|
3313
|
+
"topics",
|
|
3314
|
+
"tos",
|
|
3315
|
+
"tour",
|
|
3316
|
+
"translations",
|
|
3317
|
+
"trends",
|
|
3318
|
+
"tutorial",
|
|
3319
|
+
"tux",
|
|
3320
|
+
"tv",
|
|
3321
|
+
"twitter",
|
|
3322
|
+
"undef",
|
|
3323
|
+
"unfollow",
|
|
3324
|
+
"unsubscribe",
|
|
3325
|
+
"update",
|
|
3326
|
+
"upload",
|
|
3327
|
+
"uploads",
|
|
3328
|
+
"url",
|
|
3329
|
+
"usage",
|
|
3330
|
+
"user",
|
|
3331
|
+
"username",
|
|
3332
|
+
"users",
|
|
3333
|
+
"usuario",
|
|
3334
|
+
"vendas",
|
|
3335
|
+
"ver",
|
|
3336
|
+
"version",
|
|
3337
|
+
"video",
|
|
3338
|
+
"videos",
|
|
3339
|
+
"visitor",
|
|
3340
|
+
"watch",
|
|
3341
|
+
"weather",
|
|
3342
|
+
"web",
|
|
3343
|
+
"webhook",
|
|
3344
|
+
"webhooks",
|
|
3345
|
+
"webmail",
|
|
3346
|
+
"webmaster",
|
|
3347
|
+
"website",
|
|
3348
|
+
"websites",
|
|
3349
|
+
"welcome",
|
|
3350
|
+
"widget",
|
|
3351
|
+
"widgets",
|
|
3352
|
+
"wiki",
|
|
3353
|
+
"win",
|
|
3354
|
+
"windows",
|
|
3355
|
+
"word",
|
|
3356
|
+
"work",
|
|
3357
|
+
"works",
|
|
3358
|
+
"workshop",
|
|
3359
|
+
"ww",
|
|
3360
|
+
"wws",
|
|
3361
|
+
"www",
|
|
3362
|
+
"www1",
|
|
3363
|
+
"www2",
|
|
3364
|
+
"www3",
|
|
3365
|
+
"www4",
|
|
3366
|
+
"www5",
|
|
3367
|
+
"www6",
|
|
3368
|
+
"www7",
|
|
3369
|
+
"wwws",
|
|
3370
|
+
"wwww",
|
|
3371
|
+
"xfn",
|
|
3372
|
+
"xml",
|
|
3373
|
+
"xmpp",
|
|
3374
|
+
"xpg",
|
|
3375
|
+
"xxx",
|
|
3376
|
+
"yaml",
|
|
3377
|
+
"year",
|
|
3378
|
+
"yml",
|
|
3379
|
+
"you",
|
|
3380
|
+
"yourdomain",
|
|
3381
|
+
"yourname",
|
|
3382
|
+
"yoursite",
|
|
3383
|
+
"yourusername",
|
|
3384
|
+
"latest",
|
|
3385
|
+
"live",
|
|
3386
|
+
"preview",
|
|
3387
|
+
"learn",
|
|
3388
|
+
"supernova",
|
|
3389
|
+
"super-nova"
|
|
3390
|
+
];
|
|
3391
|
+
var RESERVED_SLUGS_SET = new Set(RESERVED_SLUGS);
|
|
2677
3392
|
|
|
2678
|
-
// src/api/
|
|
2679
|
-
|
|
3393
|
+
// src/api/conversion/documentation/documentation-page-to-dto-utils.ts
|
|
3394
|
+
function buildDocPagePublishPaths(groups, pages) {
|
|
3395
|
+
const groupPersistentIdToGroupMap = mapByUnique(groups, (group) => group.persistentId);
|
|
3396
|
+
const result = /* @__PURE__ */ new Map();
|
|
3397
|
+
for (const page of pages) {
|
|
3398
|
+
const parentChain = calculateElementParentChain(page.parentPersistentId, groupPersistentIdToGroupMap);
|
|
3399
|
+
let pathV1 = `${page.userSlug || page.slug}.html`;
|
|
3400
|
+
let pathV2 = `${slugify(page.meta.name)}-${page.shortPersistentId}`;
|
|
3401
|
+
for (const parent of parentChain) {
|
|
3402
|
+
if (!parent.parentPersistentId)
|
|
3403
|
+
continue;
|
|
3404
|
+
pathV1 = `${parent.userSlug || parent.slug}/${pathV1}`;
|
|
3405
|
+
pathV2 = `${slugify(parent.meta.name)}/${pathV2}`;
|
|
3406
|
+
}
|
|
3407
|
+
pathV1 = `/${pathV1}`;
|
|
3408
|
+
pathV2 = `/${pathV2}`;
|
|
3409
|
+
result.set(page.persistentId, pathV2);
|
|
3410
|
+
}
|
|
3411
|
+
return result;
|
|
3412
|
+
}
|
|
3413
|
+
function calculateElementParentChain(elementParentPersistentId, groupPersistentIdToGroupMap) {
|
|
3414
|
+
const result = [];
|
|
3415
|
+
let parentId = elementParentPersistentId;
|
|
3416
|
+
while (parentId) {
|
|
3417
|
+
const parent = groupPersistentIdToGroupMap.get(parentId);
|
|
3418
|
+
if (parent)
|
|
3419
|
+
result.push(parent);
|
|
3420
|
+
parentId = _optionalChain([parent, 'optionalAccess', _3 => _3.parentPersistentId]);
|
|
3421
|
+
}
|
|
3422
|
+
return result;
|
|
3423
|
+
}
|
|
3424
|
+
|
|
3425
|
+
// src/api/conversion/documentation/documentation-page-v2-to-dto.ts
|
|
3426
|
+
function documentationPagesToStructureDTOV2(pages, groups) {
|
|
3427
|
+
const pathsMap = buildDocPagePublishPaths(groups, pages);
|
|
3428
|
+
return pages.map((page) => documentationPageToStructureDTOV2(page, pathsMap));
|
|
3429
|
+
}
|
|
3430
|
+
function documentationPagesToDTOV2(pages, groups) {
|
|
3431
|
+
const pathsMap = buildDocPagePublishPaths(groups, pages);
|
|
3432
|
+
return pages.map((page) => {
|
|
3433
|
+
return {
|
|
3434
|
+
...documentationPageToStructureDTOV2(page, pathsMap),
|
|
3435
|
+
configuration: _nullishCoalesce(page.data.configuration, () => ( {
|
|
3436
|
+
showSidebar: true,
|
|
3437
|
+
header: defaultDocumentationItemHeader
|
|
3438
|
+
}))
|
|
3439
|
+
};
|
|
3440
|
+
});
|
|
3441
|
+
}
|
|
3442
|
+
function documentationPageToStructureDTOV2(page, pagePathMap) {
|
|
3443
|
+
let path = pagePathMap.get(page.persistentId);
|
|
3444
|
+
if (!path)
|
|
3445
|
+
throw new Error(`Path for page ${page.id} was not calculated`);
|
|
3446
|
+
if (path.startsWith("/"))
|
|
3447
|
+
path = path.substring(1);
|
|
3448
|
+
return {
|
|
3449
|
+
id: page.id,
|
|
3450
|
+
designSystemVersionId: page.designSystemVersionId,
|
|
3451
|
+
persistentId: page.persistentId,
|
|
3452
|
+
shortPersistentId: page.shortPersistentId,
|
|
3453
|
+
title: page.meta.name,
|
|
3454
|
+
slug: page.slug,
|
|
3455
|
+
userSlug: page.userSlug,
|
|
3456
|
+
createdAt: page.createdAt,
|
|
3457
|
+
updatedAt: page.updatedAt,
|
|
3458
|
+
path
|
|
3459
|
+
};
|
|
3460
|
+
}
|
|
3461
|
+
|
|
3462
|
+
// src/api/conversion/documentation/documentation-group-to-dto.ts
|
|
3463
|
+
function elementGroupsToDocumentationGroupStructureDTO(groups, pages) {
|
|
3464
|
+
const childrenIdsMap = calculateChildrenIdsMap(pages, groups);
|
|
3465
|
+
return groups.map((group) => elementGroupToDocumentationGroupStructureDTO(group, childrenIdsMap));
|
|
3466
|
+
}
|
|
3467
|
+
function elementGroupsToDocumentationGroupDTO(groups, pages) {
|
|
3468
|
+
const childrenIdsMap = calculateChildrenIdsMap(pages, groups);
|
|
3469
|
+
return groups.map((group) => {
|
|
3470
|
+
return {
|
|
3471
|
+
...elementGroupToDocumentationGroupStructureDTO(group, childrenIdsMap),
|
|
3472
|
+
configuration: _nullishCoalesce(_optionalChain([group, 'access', _4 => _4.data, 'optionalAccess', _5 => _5.configuration]), () => ( {
|
|
3473
|
+
showSidebar: true,
|
|
3474
|
+
header: defaultDocumentationItemHeader
|
|
3475
|
+
}))
|
|
3476
|
+
};
|
|
3477
|
+
});
|
|
3478
|
+
}
|
|
3479
|
+
function elementGroupToDocumentationGroupStructureDTO(group, childrenIdsMap) {
|
|
3480
|
+
const childrenIds = _nullishCoalesce(childrenIdsMap.get(group.persistentId), () => ( []));
|
|
3481
|
+
if (!group.shortPersistentId) {
|
|
3482
|
+
throw new Error(`Short persistent id is required for docs groups, group id: ${group.id}`);
|
|
3483
|
+
}
|
|
3484
|
+
return {
|
|
3485
|
+
id: group.id,
|
|
3486
|
+
designSystemVersionId: group.designSystemVersionId,
|
|
3487
|
+
persistentId: group.persistentId,
|
|
3488
|
+
slug: group.slug,
|
|
3489
|
+
userSlug: group.userSlug,
|
|
3490
|
+
createdAt: group.createdAt,
|
|
3491
|
+
updatedAt: group.updatedAt,
|
|
3492
|
+
title: group.meta.name,
|
|
3493
|
+
childrenIds,
|
|
3494
|
+
isRoot: !group.parentPersistentId,
|
|
3495
|
+
groupBehavior: _nullishCoalesce(_optionalChain([group, 'access', _6 => _6.data, 'optionalAccess', _7 => _7.behavior]), () => ( "Group")),
|
|
3496
|
+
shortPersistentId: group.shortPersistentId
|
|
3497
|
+
};
|
|
3498
|
+
}
|
|
3499
|
+
function calculateChildrenIdsMap(elements, groups) {
|
|
3500
|
+
const byParentId = groupBy([...elements, ...groups], (e) => e.parentPersistentId);
|
|
3501
|
+
const childrenIdsMap = /* @__PURE__ */ new Map();
|
|
3502
|
+
for (const [parentPersistentId, children] of byParentId) {
|
|
3503
|
+
if (!parentPersistentId)
|
|
3504
|
+
continue;
|
|
3505
|
+
children.sort((lhs, rhs) => lhs.sortOrder - rhs.sortOrder);
|
|
3506
|
+
childrenIdsMap.set(
|
|
3507
|
+
parentPersistentId,
|
|
3508
|
+
children.map((c) => c.persistentId)
|
|
3509
|
+
);
|
|
3510
|
+
}
|
|
3511
|
+
return childrenIdsMap;
|
|
3512
|
+
}
|
|
3513
|
+
|
|
3514
|
+
// src/api/conversion/documentation/documentation-elements-to-hierarchy-v2-dto.ts
|
|
3515
|
+
function documentationElementsToHierarchyDto(docPages, docGroups) {
|
|
3516
|
+
return {
|
|
3517
|
+
pages: documentationPagesToStructureDTOV2(docPages, docGroups),
|
|
3518
|
+
groups: elementGroupsToDocumentationGroupStructureDTO(docGroups, docPages)
|
|
3519
|
+
};
|
|
3520
|
+
}
|
|
3521
|
+
|
|
3522
|
+
// src/api/conversion/documentation/documentation-page-v1-to-dto.ts
|
|
3523
|
+
function documentationPagesToDTOV1(pages, groups) {
|
|
3524
|
+
const pathsMap = buildDocPagePublishPaths(groups, pages);
|
|
3525
|
+
return pages.map((page) => {
|
|
3526
|
+
let path = pathsMap.get(page.persistentId);
|
|
3527
|
+
if (!path)
|
|
3528
|
+
throw SupernovaException.conflict(`Path for page ${page.id} was not calculated`);
|
|
3529
|
+
if (path.startsWith("/"))
|
|
3530
|
+
path = path.substring(1);
|
|
3531
|
+
return {
|
|
3532
|
+
id: page.id,
|
|
3533
|
+
designSystemVersionId: page.designSystemVersionId,
|
|
3534
|
+
persistentId: page.persistentId,
|
|
3535
|
+
shortPersistentId: page.shortPersistentId,
|
|
3536
|
+
title: page.meta.name,
|
|
3537
|
+
blocks: page.data.blocks,
|
|
3538
|
+
slug: page.slug,
|
|
3539
|
+
userSlug: page.userSlug,
|
|
3540
|
+
configuration: _nullishCoalesce(page.data.configuration, () => ( {
|
|
3541
|
+
showSidebar: true,
|
|
3542
|
+
header: defaultDocumentationItemHeader
|
|
3543
|
+
})),
|
|
3544
|
+
createdAt: page.createdAt,
|
|
3545
|
+
updatedAt: page.updatedAt,
|
|
3546
|
+
path
|
|
3547
|
+
};
|
|
3548
|
+
});
|
|
3549
|
+
}
|
|
3550
|
+
|
|
3551
|
+
// src/api/dto/design-systems/design-system.ts
|
|
3552
|
+
var DTODesignSystem = DesignSystem.omit({
|
|
2680
3553
|
name: true,
|
|
2681
3554
|
description: true
|
|
2682
3555
|
}).extend({
|
|
2683
3556
|
meta: ObjectMeta
|
|
2684
3557
|
});
|
|
2685
3558
|
|
|
2686
|
-
// src/api/dto/documentation-
|
|
2687
|
-
|
|
2688
|
-
var DocumentationPageV1DTO = DocumentationPageV1.omit({
|
|
2689
|
-
data: true,
|
|
2690
|
-
meta: true,
|
|
2691
|
-
parentPersistentId: true,
|
|
2692
|
-
sortOrder: true
|
|
2693
|
-
}).extend(DocumentationPageV1.shape.data.shape).extend({
|
|
2694
|
-
title: _zod.z.string(),
|
|
2695
|
-
path: _zod.z.string()
|
|
2696
|
-
});
|
|
2697
|
-
|
|
2698
|
-
// src/api/dto/documentation-v2.ts
|
|
3559
|
+
// src/api/dto/elements/documentation/group-action.ts
|
|
2699
3560
|
|
|
2700
3561
|
|
|
2701
|
-
// src/api/dto/documentation.ts
|
|
3562
|
+
// src/api/dto/elements/documentation/group.ts
|
|
2702
3563
|
|
|
2703
|
-
var
|
|
3564
|
+
var DTODocumentationGroupStructure = ElementGroup.omit({
|
|
2704
3565
|
sortOrder: true,
|
|
2705
3566
|
parentPersistentId: true,
|
|
2706
3567
|
brandPersistentId: true,
|
|
@@ -2715,11 +3576,96 @@ var DocumentationGroupStructureDTO = ElementGroup.omit({
|
|
|
2715
3576
|
groupBehavior: DocumentationGroupBehavior,
|
|
2716
3577
|
shortPersistentId: _zod.z.string()
|
|
2717
3578
|
});
|
|
2718
|
-
var
|
|
3579
|
+
var DTODocumentationGroup = DTODocumentationGroupStructure.extend({
|
|
2719
3580
|
configuration: DocumentationItemConfiguration
|
|
2720
3581
|
});
|
|
3582
|
+
var DTOCreateDocumentationGroupInput = _zod.z.object({
|
|
3583
|
+
// Identifier
|
|
3584
|
+
persistentId: _zod.z.string().uuid(),
|
|
3585
|
+
// Group properties
|
|
3586
|
+
title: _zod.z.string(),
|
|
3587
|
+
configuration: DocumentationItemConfiguration.optional(),
|
|
3588
|
+
groupBehavior: DocumentationGroupBehavior,
|
|
3589
|
+
// Group placement properties
|
|
3590
|
+
afterPersistentId: _zod.z.string().uuid().optional(),
|
|
3591
|
+
parentPersistentId: _zod.z.string().uuid()
|
|
3592
|
+
});
|
|
3593
|
+
var DTOUpdateDocumentationGroupInput = _zod.z.object({
|
|
3594
|
+
// Identifier of the group to update
|
|
3595
|
+
id: _zod.z.string().uuid(),
|
|
3596
|
+
// Group properties
|
|
3597
|
+
title: _zod.z.string().optional(),
|
|
3598
|
+
configuration: DocumentationItemConfiguration.optional()
|
|
3599
|
+
});
|
|
3600
|
+
var DTODuplicateDocumentationGroupInput = _zod.z.object({
|
|
3601
|
+
// Identifier of the group to duplicate from
|
|
3602
|
+
id: _zod.z.string(),
|
|
3603
|
+
// New group persistent id
|
|
3604
|
+
persistentId: _zod.z.string().uuid(),
|
|
3605
|
+
// Group placement properties
|
|
3606
|
+
afterPersistentId: _zod.z.string().uuid().optional(),
|
|
3607
|
+
parentPersistentId: _zod.z.string().uuid()
|
|
3608
|
+
});
|
|
3609
|
+
var DTODeleteDocumentationGroupInput = _zod.z.object({
|
|
3610
|
+
// Identifier
|
|
3611
|
+
id: _zod.z.string(),
|
|
3612
|
+
// Deletion options
|
|
3613
|
+
deleteSubtree: _zod.z.boolean().default(false)
|
|
3614
|
+
});
|
|
3615
|
+
|
|
3616
|
+
// src/api/dto/elements/documentation/group-action.ts
|
|
3617
|
+
var DTODocumentationGroupCreateActionOutputV2 = _zod.z.object({
|
|
3618
|
+
type: _zod.z.literal("DocumentationGroupCreate"),
|
|
3619
|
+
output: DTODocumentationGroup
|
|
3620
|
+
});
|
|
3621
|
+
var DTODocumentationGroupUpdateActionOutputV2 = _zod.z.object({
|
|
3622
|
+
type: _zod.z.literal("DocumentationGroupUpdate"),
|
|
3623
|
+
output: DTODocumentationGroup
|
|
3624
|
+
});
|
|
3625
|
+
var DTODocumentationGroupDuplicateActionOutputV2 = _zod.z.object({
|
|
3626
|
+
type: _zod.z.literal("DocumentationGroupDuplicate"),
|
|
3627
|
+
output: DTODocumentationGroup
|
|
3628
|
+
});
|
|
3629
|
+
var DTODocumentationGroupDeleteActionOutputV2 = _zod.z.object({
|
|
3630
|
+
type: _zod.z.literal("DocumentationGroupDelete"),
|
|
3631
|
+
output: _zod.z.string()
|
|
3632
|
+
});
|
|
3633
|
+
var DTODocumentationGroupCreateActionInputV2 = _zod.z.object({
|
|
3634
|
+
type: _zod.z.literal("DocumentationGroupCreate"),
|
|
3635
|
+
input: DTOCreateDocumentationGroupInput
|
|
3636
|
+
});
|
|
3637
|
+
var DTODocumentationGroupUpdateActionInputV2 = _zod.z.object({
|
|
3638
|
+
type: _zod.z.literal("DocumentationGroupUpdate"),
|
|
3639
|
+
input: DTOUpdateDocumentationGroupInput
|
|
3640
|
+
});
|
|
3641
|
+
var DTODocumentationGroupDuplicateActionInputV2 = _zod.z.object({
|
|
3642
|
+
type: _zod.z.literal("DocumentationGroupDuplicate"),
|
|
3643
|
+
input: DTODuplicateDocumentationGroupInput
|
|
3644
|
+
});
|
|
3645
|
+
var DTODocumentationGroupDeleteActionInputV2 = _zod.z.object({
|
|
3646
|
+
type: _zod.z.literal("DocumentationGroupDelete"),
|
|
3647
|
+
input: DTODeleteDocumentationGroupInput
|
|
3648
|
+
});
|
|
3649
|
+
|
|
3650
|
+
// src/api/dto/elements/documentation/group-bulk-action.ts
|
|
3651
|
+
|
|
3652
|
+
var DTODocumentationGroupBulkActionOutputV2 = _zod.z.object({
|
|
3653
|
+
created: _zod.z.array(DTODocumentationGroup),
|
|
3654
|
+
updated: _zod.z.array(DTODocumentationGroup),
|
|
3655
|
+
deleted: _zod.z.array(_zod.z.string())
|
|
3656
|
+
});
|
|
3657
|
+
var DTODocumentationGroupBulkActionInputV2 = _zod.z.object({
|
|
3658
|
+
create: _zod.z.array(DTOCreateDocumentationGroupInput).optional(),
|
|
3659
|
+
update: _zod.z.array(DTOUpdateDocumentationGroupInput).optional(),
|
|
3660
|
+
duplicate: _zod.z.array(DTODuplicateDocumentationGroupInput).optional(),
|
|
3661
|
+
delete: _zod.z.array(_zod.z.string()).optional()
|
|
3662
|
+
});
|
|
3663
|
+
|
|
3664
|
+
// src/api/dto/elements/documentation/page-actions-v2.ts
|
|
3665
|
+
|
|
3666
|
+
|
|
3667
|
+
// src/api/dto/elements/documentation/page-v2.ts
|
|
2721
3668
|
|
|
2722
|
-
// src/api/dto/documentation-v2.ts
|
|
2723
3669
|
var DTODocumentationPageStructureV2 = DocumentationPageV2.omit({
|
|
2724
3670
|
data: true,
|
|
2725
3671
|
meta: true,
|
|
@@ -2729,72 +3675,179 @@ var DTODocumentationPageStructureV2 = DocumentationPageV2.omit({
|
|
|
2729
3675
|
title: _zod.z.string(),
|
|
2730
3676
|
path: _zod.z.string()
|
|
2731
3677
|
});
|
|
2732
|
-
var DTODocumentationPageV2 = DTODocumentationPageStructureV2.extend(
|
|
3678
|
+
var DTODocumentationPageV2 = DTODocumentationPageStructureV2.extend({
|
|
3679
|
+
configuration: DocumentationItemConfiguration
|
|
3680
|
+
});
|
|
2733
3681
|
var DTODocumentationHierarchyV2 = _zod.z.object({
|
|
2734
3682
|
pages: _zod.z.array(DTODocumentationPageStructureV2),
|
|
2735
|
-
groups: _zod.z.array(
|
|
3683
|
+
groups: _zod.z.array(DTODocumentationGroupStructure)
|
|
2736
3684
|
});
|
|
2737
|
-
|
|
2738
|
-
//
|
|
2739
|
-
|
|
2740
|
-
var DTOCreateDocumentationPageInput = _zod.z.object({
|
|
2741
|
-
parentPersistentId: _zod.z.string().uuid(),
|
|
3685
|
+
var DTOCreateDocumentationPageInputV2 = _zod.z.object({
|
|
3686
|
+
// Identifier
|
|
2742
3687
|
persistentId: _zod.z.string().uuid(),
|
|
3688
|
+
// Page properties
|
|
2743
3689
|
title: _zod.z.string(),
|
|
2744
3690
|
configuration: DocumentationItemConfiguration.optional(),
|
|
3691
|
+
// Page placement properties
|
|
3692
|
+
parentPersistentId: _zod.z.string().uuid(),
|
|
2745
3693
|
afterPersistentId: _zod.z.string().uuid().optional()
|
|
2746
3694
|
});
|
|
2747
|
-
var
|
|
3695
|
+
var DTOUpdateDocumentationPageInputV2 = _zod.z.object({
|
|
3696
|
+
// Identifier of the group to update
|
|
2748
3697
|
id: _zod.z.string(),
|
|
3698
|
+
// Page properties
|
|
2749
3699
|
title: _zod.z.string().optional(),
|
|
2750
3700
|
configuration: DocumentationItemConfiguration.optional(),
|
|
3701
|
+
// Page placement properties
|
|
2751
3702
|
parentPersistentId: _zod.z.string().optional(),
|
|
2752
3703
|
afterPersistentId: _zod.z.string().optional()
|
|
2753
3704
|
});
|
|
2754
|
-
var
|
|
3705
|
+
var DTODuplicateDocumentationPageInputV2 = _zod.z.object({
|
|
3706
|
+
// Identifier of the page to duplicate from
|
|
2755
3707
|
id: _zod.z.string(),
|
|
3708
|
+
// New page persistent id
|
|
2756
3709
|
persistentId: _zod.z.string().uuid(),
|
|
3710
|
+
// Page placement properties
|
|
2757
3711
|
parentPersistentId: _zod.z.string().uuid(),
|
|
2758
3712
|
afterPersistentId: _zod.z.string().uuid().optional()
|
|
2759
3713
|
});
|
|
2760
|
-
var
|
|
2761
|
-
|
|
2762
|
-
|
|
2763
|
-
|
|
2764
|
-
|
|
3714
|
+
var DTODeleteDocumentationPageInputV2 = _zod.z.object({
|
|
3715
|
+
// Identifier
|
|
3716
|
+
id: _zod.z.string()
|
|
3717
|
+
});
|
|
3718
|
+
|
|
3719
|
+
// src/api/dto/elements/documentation/page-actions-v2.ts
|
|
3720
|
+
var DTODocumentationPageCreateActionOutputV2 = _zod.z.object({
|
|
3721
|
+
type: _zod.z.literal("DocumentationPageCreate"),
|
|
3722
|
+
output: DTODocumentationPageV2
|
|
3723
|
+
});
|
|
3724
|
+
var DTODocumentationPageUpdateActionOutputV2 = _zod.z.object({
|
|
3725
|
+
type: _zod.z.literal("DocumentationPageUpdate"),
|
|
3726
|
+
output: DTODocumentationPageV2
|
|
3727
|
+
});
|
|
3728
|
+
var DTODocumentationPageDuplicateActionOutputV2 = _zod.z.object({
|
|
3729
|
+
type: _zod.z.literal("DocumentationPageDuplicate"),
|
|
3730
|
+
output: DTODocumentationPageV2
|
|
3731
|
+
});
|
|
3732
|
+
var DTODocumentationPageDeleteActionOutputV2 = _zod.z.object({
|
|
3733
|
+
type: _zod.z.literal("DocumentationPageDelete"),
|
|
3734
|
+
output: _zod.z.string()
|
|
3735
|
+
});
|
|
3736
|
+
var DTODocumentationPageCreateActionInputV2 = _zod.z.object({
|
|
3737
|
+
type: _zod.z.literal("DocumentationPageCreate"),
|
|
3738
|
+
input: DTOCreateDocumentationPageInputV2
|
|
2765
3739
|
});
|
|
2766
|
-
var
|
|
2767
|
-
|
|
3740
|
+
var DTODocumentationPageUpdateActionInputV2 = _zod.z.object({
|
|
3741
|
+
type: _zod.z.literal("DocumentationPageUpdate"),
|
|
3742
|
+
input: DTOUpdateDocumentationPageInputV2
|
|
3743
|
+
});
|
|
3744
|
+
var DTODocumentationPageDuplicateActionInputV2 = _zod.z.object({
|
|
3745
|
+
type: _zod.z.literal("DocumentationPageDuplicate"),
|
|
3746
|
+
input: DTODuplicateDocumentationPageInputV2
|
|
3747
|
+
});
|
|
3748
|
+
var DTODocumentationPageDeleteActionInputV2 = _zod.z.object({
|
|
3749
|
+
type: _zod.z.literal("DocumentationPageDelete"),
|
|
3750
|
+
input: DTODeleteDocumentationPageInputV2
|
|
2768
3751
|
});
|
|
2769
3752
|
|
|
2770
|
-
// src/api/
|
|
3753
|
+
// src/api/dto/elements/documentation/page-bulk-action-v2.ts
|
|
2771
3754
|
|
|
2772
|
-
var
|
|
2773
|
-
|
|
3755
|
+
var DTODocumentationPageBulkActionOutputV2 = _zod.z.object({
|
|
3756
|
+
created: _zod.z.array(DTODocumentationPageV2),
|
|
3757
|
+
updated: _zod.z.array(DTODocumentationPageV2),
|
|
3758
|
+
deleted: _zod.z.array(_zod.z.string())
|
|
2774
3759
|
});
|
|
3760
|
+
var DTODocumentationPageBulkActionInputV2 = _zod.z.object({
|
|
3761
|
+
create: _zod.z.array(DTOCreateDocumentationPageInputV2).optional(),
|
|
3762
|
+
update: _zod.z.array(DTOUpdateDocumentationPageInputV2).optional(),
|
|
3763
|
+
duplicate: _zod.z.array(DTODuplicateDocumentationPageInputV2).optional(),
|
|
3764
|
+
delete: _zod.z.array(DTODeleteDocumentationPageInputV2).optional()
|
|
3765
|
+
});
|
|
3766
|
+
|
|
3767
|
+
// src/api/dto/elements/documentation/page-v1.ts
|
|
2775
3768
|
|
|
2776
|
-
|
|
3769
|
+
var DocumentationPageV1DTO = DocumentationPageV1.omit({
|
|
3770
|
+
data: true,
|
|
3771
|
+
meta: true,
|
|
3772
|
+
parentPersistentId: true,
|
|
3773
|
+
sortOrder: true
|
|
3774
|
+
}).extend(DocumentationPageV1.shape.data.shape).extend({
|
|
3775
|
+
title: _zod.z.string(),
|
|
3776
|
+
path: _zod.z.string()
|
|
3777
|
+
});
|
|
3778
|
+
|
|
3779
|
+
// src/api/dto/elements/elements-action-v2.ts
|
|
3780
|
+
|
|
3781
|
+
var DTOElementActionOutput = _zod.z.discriminatedUnion("type", [
|
|
3782
|
+
// Documentation pages
|
|
3783
|
+
DTODocumentationPageCreateActionOutputV2,
|
|
3784
|
+
DTODocumentationPageUpdateActionOutputV2,
|
|
3785
|
+
DTODocumentationPageDuplicateActionOutputV2,
|
|
3786
|
+
DTODocumentationPageDeleteActionOutputV2,
|
|
3787
|
+
// Documentation groups
|
|
3788
|
+
DTODocumentationGroupCreateActionOutputV2,
|
|
3789
|
+
DTODocumentationGroupUpdateActionOutputV2,
|
|
3790
|
+
DTODocumentationGroupDuplicateActionOutputV2,
|
|
3791
|
+
DTODocumentationGroupDeleteActionOutputV2
|
|
3792
|
+
]);
|
|
3793
|
+
var DTOElementActionInput = _zod.z.discriminatedUnion("type", [
|
|
3794
|
+
// Documentation pages
|
|
3795
|
+
DTODocumentationPageCreateActionInputV2,
|
|
3796
|
+
DTODocumentationPageUpdateActionInputV2,
|
|
3797
|
+
DTODocumentationPageDuplicateActionInputV2,
|
|
3798
|
+
DTODocumentationPageDeleteActionInputV2,
|
|
3799
|
+
// Documentation groups
|
|
3800
|
+
DTODocumentationGroupCreateActionInputV2,
|
|
3801
|
+
DTODocumentationGroupUpdateActionInputV2,
|
|
3802
|
+
DTODocumentationGroupDuplicateActionInputV2,
|
|
3803
|
+
DTODocumentationGroupDeleteActionInputV2
|
|
3804
|
+
]);
|
|
2777
3805
|
|
|
2778
|
-
|
|
3806
|
+
// src/api/dto/elements/elements-bulk-action-v2.ts
|
|
3807
|
+
|
|
3808
|
+
var DTOElementsBulkActionOutputV2 = _zod.z.object({
|
|
3809
|
+
documentationPages: DTODocumentationPageBulkActionOutputV2
|
|
3810
|
+
});
|
|
3811
|
+
var DTOElementsBulkActionInputV2 = _zod.z.object({
|
|
3812
|
+
documentationPages: DTODocumentationPageBulkActionInputV2
|
|
3813
|
+
});
|
|
3814
|
+
|
|
3815
|
+
// src/api/payloads/documentation/block-definitions.ts
|
|
3816
|
+
|
|
3817
|
+
var DTOGetBlockDefinitionsOutput = _zod.z.object({
|
|
2779
3818
|
definitions: _zod.z.array(PageBlockDefinition)
|
|
2780
3819
|
});
|
|
2781
3820
|
|
|
2782
|
-
// src/
|
|
2783
|
-
|
|
3821
|
+
// src/api/payloads/liveblocks/auth.ts
|
|
3822
|
+
|
|
3823
|
+
var DTOLiveblocksAuthRequest = _zod.z.object({
|
|
3824
|
+
room: _zod.z.string()
|
|
3825
|
+
});
|
|
3826
|
+
|
|
3827
|
+
// src/yjs/design-system-content/documentation-hierarchy.ts
|
|
3828
|
+
function documentationHierarchyToYjs(doc, transaction) {
|
|
2784
3829
|
doc.transact((trx) => {
|
|
2785
3830
|
const pagesMap = getPagesYMap(trx.doc);
|
|
2786
|
-
|
|
2787
|
-
pagesMap.delete(
|
|
3831
|
+
transaction.pageIdsToDelete.forEach((pageId) => {
|
|
3832
|
+
pagesMap.delete(pageId);
|
|
2788
3833
|
});
|
|
2789
|
-
|
|
2790
|
-
|
|
3834
|
+
transaction.pages.forEach((page) => {
|
|
3835
|
+
const sanitizedPage = {
|
|
3836
|
+
...page,
|
|
3837
|
+
data: {}
|
|
3838
|
+
};
|
|
3839
|
+
pagesMap.set(page.id, sanitizedPage);
|
|
2791
3840
|
});
|
|
2792
3841
|
const groupsMap = getGroupsYMap(trx.doc);
|
|
2793
|
-
|
|
2794
|
-
groupsMap.delete(
|
|
3842
|
+
transaction.groupIdsToDelete.forEach((id) => {
|
|
3843
|
+
groupsMap.delete(id);
|
|
2795
3844
|
});
|
|
2796
|
-
|
|
2797
|
-
|
|
3845
|
+
transaction.groups.forEach((group) => {
|
|
3846
|
+
const sanitizedGroup = {
|
|
3847
|
+
...group,
|
|
3848
|
+
data: {}
|
|
3849
|
+
};
|
|
3850
|
+
groupsMap.set(group.id, group);
|
|
2798
3851
|
});
|
|
2799
3852
|
});
|
|
2800
3853
|
return doc;
|
|
@@ -2804,16 +3857,14 @@ function yjsToDocumentationHierarchy(doc) {
|
|
|
2804
3857
|
const groupsMap = getGroupsYMap(doc);
|
|
2805
3858
|
const pages = [];
|
|
2806
3859
|
pagesMap.forEach((page) => {
|
|
2807
|
-
pages.push(
|
|
3860
|
+
pages.push(DocumentationPageV2.parse(page));
|
|
2808
3861
|
});
|
|
2809
3862
|
const groups = [];
|
|
2810
3863
|
groupsMap.forEach((group) => {
|
|
2811
|
-
groups.push(
|
|
3864
|
+
groups.push(ElementGroup.parse(group));
|
|
2812
3865
|
});
|
|
2813
|
-
|
|
2814
|
-
|
|
2815
|
-
groups
|
|
2816
|
-
};
|
|
3866
|
+
const hierarchy = documentationElementsToHierarchyDto(pages, groups);
|
|
3867
|
+
return hierarchy;
|
|
2817
3868
|
}
|
|
2818
3869
|
function getPagesYMap(doc) {
|
|
2819
3870
|
return doc.getMap("documentationPages");
|
|
@@ -2822,7 +3873,7 @@ function getGroupsYMap(doc) {
|
|
|
2822
3873
|
return doc.getMap("documentationGroups");
|
|
2823
3874
|
}
|
|
2824
3875
|
|
|
2825
|
-
// src/design-system-content/item-configuration.ts
|
|
3876
|
+
// src/yjs/design-system-content/item-configuration.ts
|
|
2826
3877
|
function itemConfigurationToYjs(yDoc, item) {
|
|
2827
3878
|
yDoc.transact((trx) => {
|
|
2828
3879
|
const header = item.header;
|
|
@@ -2865,20 +3916,20 @@ function yjsToItemConfiguration(yDoc) {
|
|
|
2865
3916
|
return DocumentationItemConfiguration.parse(rawConfig);
|
|
2866
3917
|
}
|
|
2867
3918
|
|
|
2868
|
-
// src/docs-editor/model/block.ts
|
|
3919
|
+
// src/yjs/docs-editor/model/block.ts
|
|
2869
3920
|
|
|
2870
3921
|
var PageBlockEditorModel = _zod.z.object({
|
|
2871
3922
|
id: _zod.z.string(),
|
|
2872
3923
|
data: PageBlockDataV2
|
|
2873
3924
|
});
|
|
2874
3925
|
|
|
2875
|
-
// src/docs-editor/model/page.ts
|
|
3926
|
+
// src/yjs/docs-editor/model/page.ts
|
|
2876
3927
|
|
|
2877
3928
|
var DocumentationPageEditorModel = _zod.z.object({
|
|
2878
3929
|
blocks: _zod.z.array(PageBlockEditorModel)
|
|
2879
3930
|
});
|
|
2880
3931
|
|
|
2881
|
-
// src/docs-editor/prosemirror/schema.ts
|
|
3932
|
+
// src/yjs/docs-editor/prosemirror/schema.ts
|
|
2882
3933
|
var _prosemirrormodel = require('prosemirror-model');
|
|
2883
3934
|
var newSchema = {
|
|
2884
3935
|
nodes: {
|
|
@@ -3554,7 +4605,7 @@ var newSchema = {
|
|
|
3554
4605
|
};
|
|
3555
4606
|
var pmSchema = new (0, _prosemirrormodel.Schema)(newSchema);
|
|
3556
4607
|
|
|
3557
|
-
// src/docs-editor/utils.ts
|
|
4608
|
+
// src/yjs/docs-editor/utils.ts
|
|
3558
4609
|
var BlockParsingUtils = {
|
|
3559
4610
|
singleBlockItem(block) {
|
|
3560
4611
|
if (!block.data.items.length)
|
|
@@ -3639,7 +4690,7 @@ var BlockDefinitionUtils = {
|
|
|
3639
4690
|
}
|
|
3640
4691
|
};
|
|
3641
4692
|
|
|
3642
|
-
// src/docs-editor/blocks-to-prosemirror.ts
|
|
4693
|
+
// src/yjs/docs-editor/blocks-to-prosemirror.ts
|
|
3643
4694
|
var _yprosemirror = require('y-prosemirror');
|
|
3644
4695
|
function pageToYXmlFragment(page, definitions, fragment) {
|
|
3645
4696
|
const doc = pageToProsemirrorDoc(page, definitions);
|
|
@@ -3700,7 +4751,7 @@ function serializeAsRichTextBlock(input) {
|
|
|
3700
4751
|
const textPropertyValue = BlockParsingUtils.richTextPropertyValue(blockItem, richTextProperty.id);
|
|
3701
4752
|
const enrichedInput = { ...input, richTextPropertyValue: textPropertyValue };
|
|
3702
4753
|
const parsedOptions = PageBlockDefinitionRichTextOptions.optional().parse(richTextProperty.options);
|
|
3703
|
-
const style = _nullishCoalesce(_optionalChain([parsedOptions, 'optionalAccess',
|
|
4754
|
+
const style = _nullishCoalesce(_optionalChain([parsedOptions, 'optionalAccess', _8 => _8.richTextStyle]), () => ( "Default"));
|
|
3704
4755
|
switch (style) {
|
|
3705
4756
|
case "Callout":
|
|
3706
4757
|
return serializeAsCallout(enrichedInput);
|
|
@@ -3757,7 +4808,7 @@ function serializeAsMultiRichTextBlock(input) {
|
|
|
3757
4808
|
const textPropertyValue = BlockParsingUtils.multiRichTextPropertyValue(blockItem, multiRichTextProperty.id);
|
|
3758
4809
|
const enrichedInput = { ...input, multiRichTextPropertyValue: textPropertyValue };
|
|
3759
4810
|
const parsedOptions = PageBlockDefinitionMutiRichTextOptions.optional().parse(multiRichTextProperty.options);
|
|
3760
|
-
const style = _nullishCoalesce(_optionalChain([parsedOptions, 'optionalAccess',
|
|
4811
|
+
const style = _nullishCoalesce(_optionalChain([parsedOptions, 'optionalAccess', _9 => _9.multiRichTextStyle]), () => ( "Default"));
|
|
3761
4812
|
switch (style) {
|
|
3762
4813
|
case "Default":
|
|
3763
4814
|
return serializeAsMultiParagraph(enrichedInput);
|
|
@@ -3879,7 +4930,7 @@ function serializeTableNode(node) {
|
|
|
3879
4930
|
return {
|
|
3880
4931
|
type: "image",
|
|
3881
4932
|
attrs: {
|
|
3882
|
-
src: _optionalChain([node, 'access',
|
|
4933
|
+
src: _optionalChain([node, 'access', _10 => _10.value, 'optionalAccess', _11 => _11.url])
|
|
3883
4934
|
}
|
|
3884
4935
|
};
|
|
3885
4936
|
}
|
|
@@ -3899,7 +4950,7 @@ function serializeBlockNodeAttributes(input) {
|
|
|
3899
4950
|
};
|
|
3900
4951
|
}
|
|
3901
4952
|
function richTextHeadingLevel(property) {
|
|
3902
|
-
const style = _optionalChain([property, 'access',
|
|
4953
|
+
const style = _optionalChain([property, 'access', _12 => _12.options, 'optionalAccess', _13 => _13.richTextStyle]);
|
|
3903
4954
|
if (!style)
|
|
3904
4955
|
return void 0;
|
|
3905
4956
|
switch (style) {
|
|
@@ -3997,7 +5048,7 @@ function serializeAsCustomBlock(block, definition) {
|
|
|
3997
5048
|
linksTo: i.linksTo
|
|
3998
5049
|
};
|
|
3999
5050
|
});
|
|
4000
|
-
const columns = _optionalChain([block, 'access',
|
|
5051
|
+
const columns = _optionalChain([block, 'access', _14 => _14.data, 'access', _15 => _15.appearance, 'optionalAccess', _16 => _16.numberOfColumns]);
|
|
4001
5052
|
return {
|
|
4002
5053
|
type: "blockNode",
|
|
4003
5054
|
attrs: {
|
|
@@ -4013,7 +5064,7 @@ function nonNullFilter(item) {
|
|
|
4013
5064
|
return !!item;
|
|
4014
5065
|
}
|
|
4015
5066
|
|
|
4016
|
-
// src/docs-editor/mock.ts
|
|
5067
|
+
// src/yjs/docs-editor/mock.ts
|
|
4017
5068
|
function getMockPageBlockDefinitions() {
|
|
4018
5069
|
return blocks;
|
|
4019
5070
|
}
|
|
@@ -6506,7 +7557,7 @@ var blocks = [
|
|
|
6506
7557
|
}
|
|
6507
7558
|
];
|
|
6508
7559
|
|
|
6509
|
-
// src/docs-editor/prosemirror-to-blocks.ts
|
|
7560
|
+
// src/yjs/docs-editor/prosemirror-to-blocks.ts
|
|
6510
7561
|
|
|
6511
7562
|
|
|
6512
7563
|
function yDocToPage(yDoc, definitions) {
|
|
@@ -6517,7 +7568,7 @@ function yXmlFragmentToPage(fragment, definitions) {
|
|
|
6517
7568
|
return prosemirrorDocToPage(prosemirrorJson, definitions);
|
|
6518
7569
|
}
|
|
6519
7570
|
function prosemirrorDocToPage(prosemirrorDoc, definitions) {
|
|
6520
|
-
const definitionsById =
|
|
7571
|
+
const definitionsById = mapByUnique2(definitions, (d) => d.id);
|
|
6521
7572
|
return {
|
|
6522
7573
|
blocks: (_nullishCoalesce(prosemirrorDoc.content, () => ( []))).map((prosemirrorNode) => {
|
|
6523
7574
|
const definitionId = getProsemirrorAttribute(prosemirrorNode, "definitionId", _zod.z.string());
|
|
@@ -6623,7 +7674,7 @@ function parseAsMultiRichText(prosemirrorNode, definition, property) {
|
|
|
6623
7674
|
value: (_nullishCoalesce(prosemirrorNode.content, () => ( []))).map((listItem) => {
|
|
6624
7675
|
if (listItem.type !== "listItem")
|
|
6625
7676
|
return null;
|
|
6626
|
-
if (!_optionalChain([listItem, 'access',
|
|
7677
|
+
if (!_optionalChain([listItem, 'access', _17 => _17.content, 'optionalAccess', _18 => _18.length]))
|
|
6627
7678
|
return parseRichText([]);
|
|
6628
7679
|
const paragraph = listItem.content[0];
|
|
6629
7680
|
if (paragraph.type !== "paragraph")
|
|
@@ -6666,7 +7717,7 @@ function parseRichTextAttribute(mark) {
|
|
|
6666
7717
|
const href = getProsemirrorAttribute(mark, "href", _zod.z.string().optional());
|
|
6667
7718
|
return {
|
|
6668
7719
|
type: "Link",
|
|
6669
|
-
openInNewWindow: _optionalChain([mark, 'access',
|
|
7720
|
+
openInNewWindow: _optionalChain([mark, 'access', _19 => _19.attrs, 'optionalAccess', _20 => _20.target]) !== "_self",
|
|
6670
7721
|
documentationItemId: itemId,
|
|
6671
7722
|
link: href
|
|
6672
7723
|
};
|
|
@@ -6679,17 +7730,17 @@ function parseAsTable(prosemirrorNode, definition, property) {
|
|
|
6679
7730
|
return null;
|
|
6680
7731
|
const variantId = getProsemirrorBlockVariantId(prosemirrorNode);
|
|
6681
7732
|
const hasBorder = getProsemirrorAttribute(prosemirrorNode, "hasBorder", _zod.z.boolean().optional()) !== false;
|
|
6682
|
-
const tableChild = _optionalChain([prosemirrorNode, 'access',
|
|
7733
|
+
const tableChild = _optionalChain([prosemirrorNode, 'access', _21 => _21.content, 'optionalAccess', _22 => _22.find, 'call', _23 => _23((c) => c.type === "table")]);
|
|
6683
7734
|
if (!tableChild) {
|
|
6684
7735
|
return emptyTable(id, variantId, 0);
|
|
6685
7736
|
}
|
|
6686
|
-
const rows = _nullishCoalesce(_optionalChain([tableChild, 'access',
|
|
7737
|
+
const rows = _nullishCoalesce(_optionalChain([tableChild, 'access', _24 => _24.content, 'optionalAccess', _25 => _25.filter, 'call', _26 => _26((c) => c.type === "tableRow" && !!_optionalChain([c, 'access', _27 => _27.content, 'optionalAccess', _28 => _28.length]))]), () => ( []));
|
|
6687
7738
|
if (!rows.length) {
|
|
6688
7739
|
return emptyTable(id, variantId, 0);
|
|
6689
7740
|
}
|
|
6690
|
-
const rowHeaderCells = _nullishCoalesce(_optionalChain([rows, 'access',
|
|
6691
|
-
const columnHeaderCells = rows.filter((r) => _optionalChain([r, 'access',
|
|
6692
|
-
const hasHeaderRow = _optionalChain([rows, 'access',
|
|
7741
|
+
const rowHeaderCells = _nullishCoalesce(_optionalChain([rows, 'access', _29 => _29[0], 'access', _30 => _30.content, 'optionalAccess', _31 => _31.filter, 'call', _32 => _32((c) => c.type === "tableHeader"), 'access', _33 => _33.length]), () => ( 0));
|
|
7742
|
+
const columnHeaderCells = rows.filter((r) => _optionalChain([r, 'access', _34 => _34.content, 'optionalAccess', _35 => _35[0], 'optionalAccess', _36 => _36.type]) === "tableHeader").length;
|
|
7743
|
+
const hasHeaderRow = _optionalChain([rows, 'access', _37 => _37[0], 'access', _38 => _38.content, 'optionalAccess', _39 => _39.length]) === rowHeaderCells;
|
|
6693
7744
|
const hasHeaderColumn = rows.length === columnHeaderCells;
|
|
6694
7745
|
const tableValue = {
|
|
6695
7746
|
showBorder: hasBorder,
|
|
@@ -6970,7 +8021,7 @@ function getProsemirrorBlockVariantId(prosemirrorNode) {
|
|
|
6970
8021
|
return getProsemirrorAttribute(prosemirrorNode, "variantId", nullishToOptional(_zod.z.string()));
|
|
6971
8022
|
}
|
|
6972
8023
|
function getProsemirrorAttribute(prosemirrorNode, attributeName, validationSchema) {
|
|
6973
|
-
const parsedAttr = validationSchema.safeParse(_optionalChain([prosemirrorNode, 'access',
|
|
8024
|
+
const parsedAttr = validationSchema.safeParse(_optionalChain([prosemirrorNode, 'access', _40 => _40.attrs, 'optionalAccess', _41 => _41[attributeName]]));
|
|
6974
8025
|
if (parsedAttr.success) {
|
|
6975
8026
|
return parsedAttr.data;
|
|
6976
8027
|
} else {
|
|
@@ -6982,7 +8033,7 @@ function getProsemirrorAttribute(prosemirrorNode, attributeName, validationSchem
|
|
|
6982
8033
|
function nonNullFilter2(item) {
|
|
6983
8034
|
return item !== null;
|
|
6984
8035
|
}
|
|
6985
|
-
function
|
|
8036
|
+
function mapByUnique2(items, keyFn) {
|
|
6986
8037
|
const result = /* @__PURE__ */ new Map();
|
|
6987
8038
|
for (const item of items) {
|
|
6988
8039
|
result.set(keyFn(item), item);
|
|
@@ -7023,5 +8074,40 @@ function mapByUnique(items, keyFn) {
|
|
|
7023
8074
|
|
|
7024
8075
|
|
|
7025
8076
|
|
|
7026
|
-
|
|
8077
|
+
|
|
8078
|
+
|
|
8079
|
+
|
|
8080
|
+
|
|
8081
|
+
|
|
8082
|
+
|
|
8083
|
+
|
|
8084
|
+
|
|
8085
|
+
|
|
8086
|
+
|
|
8087
|
+
|
|
8088
|
+
|
|
8089
|
+
|
|
8090
|
+
|
|
8091
|
+
|
|
8092
|
+
|
|
8093
|
+
|
|
8094
|
+
|
|
8095
|
+
|
|
8096
|
+
|
|
8097
|
+
|
|
8098
|
+
|
|
8099
|
+
|
|
8100
|
+
|
|
8101
|
+
|
|
8102
|
+
|
|
8103
|
+
|
|
8104
|
+
|
|
8105
|
+
|
|
8106
|
+
|
|
8107
|
+
|
|
8108
|
+
|
|
8109
|
+
|
|
8110
|
+
|
|
8111
|
+
|
|
8112
|
+
exports.BlockDefinitionUtils = BlockDefinitionUtils; exports.BlockParsingUtils = BlockParsingUtils; exports.DTOCreateDocumentationGroupInput = DTOCreateDocumentationGroupInput; exports.DTOCreateDocumentationPageInputV2 = DTOCreateDocumentationPageInputV2; exports.DTODeleteDocumentationGroupInput = DTODeleteDocumentationGroupInput; exports.DTODeleteDocumentationPageInputV2 = DTODeleteDocumentationPageInputV2; exports.DTODesignSystem = DTODesignSystem; exports.DTODocumentationGroup = DTODocumentationGroup; exports.DTODocumentationGroupBulkActionInputV2 = DTODocumentationGroupBulkActionInputV2; exports.DTODocumentationGroupBulkActionOutputV2 = DTODocumentationGroupBulkActionOutputV2; exports.DTODocumentationGroupCreateActionInputV2 = DTODocumentationGroupCreateActionInputV2; exports.DTODocumentationGroupCreateActionOutputV2 = DTODocumentationGroupCreateActionOutputV2; exports.DTODocumentationGroupDeleteActionInputV2 = DTODocumentationGroupDeleteActionInputV2; exports.DTODocumentationGroupDeleteActionOutputV2 = DTODocumentationGroupDeleteActionOutputV2; exports.DTODocumentationGroupDuplicateActionInputV2 = DTODocumentationGroupDuplicateActionInputV2; exports.DTODocumentationGroupDuplicateActionOutputV2 = DTODocumentationGroupDuplicateActionOutputV2; exports.DTODocumentationGroupStructure = DTODocumentationGroupStructure; exports.DTODocumentationGroupUpdateActionInputV2 = DTODocumentationGroupUpdateActionInputV2; exports.DTODocumentationGroupUpdateActionOutputV2 = DTODocumentationGroupUpdateActionOutputV2; exports.DTODocumentationHierarchyV2 = DTODocumentationHierarchyV2; exports.DTODocumentationPageBulkActionInputV2 = DTODocumentationPageBulkActionInputV2; exports.DTODocumentationPageBulkActionOutputV2 = DTODocumentationPageBulkActionOutputV2; exports.DTODocumentationPageCreateActionInputV2 = DTODocumentationPageCreateActionInputV2; exports.DTODocumentationPageCreateActionOutputV2 = DTODocumentationPageCreateActionOutputV2; exports.DTODocumentationPageDeleteActionInputV2 = DTODocumentationPageDeleteActionInputV2; exports.DTODocumentationPageDeleteActionOutputV2 = DTODocumentationPageDeleteActionOutputV2; exports.DTODocumentationPageDuplicateActionInputV2 = DTODocumentationPageDuplicateActionInputV2; exports.DTODocumentationPageDuplicateActionOutputV2 = DTODocumentationPageDuplicateActionOutputV2; exports.DTODocumentationPageStructureV2 = DTODocumentationPageStructureV2; exports.DTODocumentationPageUpdateActionInputV2 = DTODocumentationPageUpdateActionInputV2; exports.DTODocumentationPageUpdateActionOutputV2 = DTODocumentationPageUpdateActionOutputV2; exports.DTODocumentationPageV2 = DTODocumentationPageV2; exports.DTODuplicateDocumentationGroupInput = DTODuplicateDocumentationGroupInput; exports.DTODuplicateDocumentationPageInputV2 = DTODuplicateDocumentationPageInputV2; exports.DTOElementActionInput = DTOElementActionInput; exports.DTOElementActionOutput = DTOElementActionOutput; exports.DTOElementsBulkActionInputV2 = DTOElementsBulkActionInputV2; exports.DTOElementsBulkActionOutputV2 = DTOElementsBulkActionOutputV2; exports.DTOGetBlockDefinitionsOutput = DTOGetBlockDefinitionsOutput; exports.DTOLiveblocksAuthRequest = DTOLiveblocksAuthRequest; exports.DTOUpdateDocumentationGroupInput = DTOUpdateDocumentationGroupInput; exports.DTOUpdateDocumentationPageInputV2 = DTOUpdateDocumentationPageInputV2; exports.DocumentationPageEditorModel = DocumentationPageEditorModel; exports.DocumentationPageV1DTO = DocumentationPageV1DTO; exports.PageBlockEditorModel = PageBlockEditorModel; exports.blockDefinitionForBlock = blockDefinitionForBlock; exports.blockToProsemirrorNode = blockToProsemirrorNode; exports.buildDocPagePublishPaths = buildDocPagePublishPaths; exports.calculateElementParentChain = calculateElementParentChain; exports.documentationElementsToHierarchyDto = documentationElementsToHierarchyDto; exports.documentationHierarchyToYjs = documentationHierarchyToYjs; exports.documentationPagesToDTOV1 = documentationPagesToDTOV1; exports.documentationPagesToDTOV2 = documentationPagesToDTOV2; exports.documentationPagesToStructureDTOV2 = documentationPagesToStructureDTOV2; exports.elementGroupsToDocumentationGroupDTO = elementGroupsToDocumentationGroupDTO; exports.elementGroupsToDocumentationGroupStructureDTO = elementGroupsToDocumentationGroupStructureDTO; exports.getMockPageBlockDefinitions = getMockPageBlockDefinitions; exports.itemConfigurationToYjs = itemConfigurationToYjs; exports.pageToProsemirrorDoc = pageToProsemirrorDoc; exports.pageToYXmlFragment = pageToYXmlFragment; exports.pmSchema = pmSchema; exports.prosemirrorDocToPage = prosemirrorDocToPage; exports.prosemirrorNodeToBlock = prosemirrorNodeToBlock; exports.serializeAsCustomBlock = serializeAsCustomBlock; exports.yDocToPage = yDocToPage; exports.yXmlFragmentToPage = yXmlFragmentToPage; exports.yjsToDocumentationHierarchy = yjsToDocumentationHierarchy; exports.yjsToItemConfiguration = yjsToItemConfiguration;
|
|
7027
8113
|
//# sourceMappingURL=index.js.map
|