Initial docs rendering kinda works
This commit is contained in:
parent
ada6cbf461
commit
b699a39b0f
|
@ -68,6 +68,15 @@
|
||||||
"kind": 256,
|
"kind": 256,
|
||||||
"kindString": "Interface",
|
"kindString": "Interface",
|
||||||
"flags": {},
|
"flags": {},
|
||||||
|
"comment": {
|
||||||
|
"shortText": "Schlechtenburg inputs and outputs a plain JS Object that can be JSON stringified. This is the\ninterface type for that data structure. <T> will be the data type of the specific block being",
|
||||||
|
"tags": [
|
||||||
|
{
|
||||||
|
"tag": "see",
|
||||||
|
"text": "SbMain\n"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
"children": [
|
"children": [
|
||||||
{
|
{
|
||||||
"id": 13,
|
"id": 13,
|
||||||
|
@ -78,7 +87,7 @@
|
||||||
"sources": [
|
"sources": [
|
||||||
{
|
{
|
||||||
"fileName": "types.ts",
|
"fileName": "types.ts",
|
||||||
"line": 13,
|
"line": 25,
|
||||||
"character": 2
|
"character": 2
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
@ -97,7 +106,7 @@
|
||||||
"sources": [
|
"sources": [
|
||||||
{
|
{
|
||||||
"fileName": "types.ts",
|
"fileName": "types.ts",
|
||||||
"line": 11,
|
"line": 23,
|
||||||
"character": 2
|
"character": 2
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
@ -115,7 +124,7 @@
|
||||||
"sources": [
|
"sources": [
|
||||||
{
|
{
|
||||||
"fileName": "types.ts",
|
"fileName": "types.ts",
|
||||||
"line": 12,
|
"line": 24,
|
||||||
"character": 2
|
"character": 2
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
@ -139,7 +148,7 @@
|
||||||
"sources": [
|
"sources": [
|
||||||
{
|
{
|
||||||
"fileName": "types.ts",
|
"fileName": "types.ts",
|
||||||
"line": 10,
|
"line": 22,
|
||||||
"character": 17
|
"character": 17
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
@ -151,6 +160,15 @@
|
||||||
"kindString": "Type parameter",
|
"kindString": "Type parameter",
|
||||||
"flags": {}
|
"flags": {}
|
||||||
}
|
}
|
||||||
|
],
|
||||||
|
"typeParameters": [
|
||||||
|
{
|
||||||
|
"id": 14,
|
||||||
|
"name": "T",
|
||||||
|
"kind": 131072,
|
||||||
|
"kindString": "Type parameter",
|
||||||
|
"flags": {}
|
||||||
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -159,6 +177,15 @@
|
||||||
"kind": 256,
|
"kind": 256,
|
||||||
"kindString": "Interface",
|
"kindString": "Interface",
|
||||||
"flags": {},
|
"flags": {},
|
||||||
|
"comment": {
|
||||||
|
"shortText": "Any Block that you create",
|
||||||
|
"tags": [
|
||||||
|
{
|
||||||
|
"tag": "see",
|
||||||
|
"text": "IBlockProps\n"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
"children": [
|
"children": [
|
||||||
{
|
{
|
||||||
"id": 56,
|
"id": 56,
|
||||||
|
@ -169,7 +196,7 @@
|
||||||
"sources": [
|
"sources": [
|
||||||
{
|
{
|
||||||
"fileName": "types.ts",
|
"fileName": "types.ts",
|
||||||
"line": 40,
|
"line": 162,
|
||||||
"character": 2
|
"character": 2
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
@ -223,7 +250,7 @@
|
||||||
"sources": [
|
"sources": [
|
||||||
{
|
{
|
||||||
"fileName": "types.ts",
|
"fileName": "types.ts",
|
||||||
"line": 39,
|
"line": 161,
|
||||||
"character": 2
|
"character": 2
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
@ -277,7 +304,7 @@
|
||||||
"sources": [
|
"sources": [
|
||||||
{
|
{
|
||||||
"fileName": "types.ts",
|
"fileName": "types.ts",
|
||||||
"line": 38,
|
"line": 160,
|
||||||
"character": 2
|
"character": 2
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
@ -298,7 +325,7 @@
|
||||||
"sources": [
|
"sources": [
|
||||||
{
|
{
|
||||||
"fileName": "types.ts",
|
"fileName": "types.ts",
|
||||||
"line": 37,
|
"line": 159,
|
||||||
"character": 2
|
"character": 2
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
@ -316,7 +343,7 @@
|
||||||
"sources": [
|
"sources": [
|
||||||
{
|
{
|
||||||
"fileName": "types.ts",
|
"fileName": "types.ts",
|
||||||
"line": 36,
|
"line": 158,
|
||||||
"character": 2
|
"character": 2
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
@ -342,7 +369,7 @@
|
||||||
"sources": [
|
"sources": [
|
||||||
{
|
{
|
||||||
"fileName": "types.ts",
|
"fileName": "types.ts",
|
||||||
"line": 35,
|
"line": 157,
|
||||||
"character": 17
|
"character": 17
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
@ -354,6 +381,15 @@
|
||||||
"kindString": "Type parameter",
|
"kindString": "Type parameter",
|
||||||
"flags": {}
|
"flags": {}
|
||||||
}
|
}
|
||||||
|
],
|
||||||
|
"typeParameters": [
|
||||||
|
{
|
||||||
|
"id": 57,
|
||||||
|
"name": "T",
|
||||||
|
"kind": 131072,
|
||||||
|
"kindString": "Type parameter",
|
||||||
|
"flags": {}
|
||||||
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -362,10 +398,19 @@
|
||||||
"kind": 256,
|
"kind": 256,
|
||||||
"kindString": "Interface",
|
"kindString": "Interface",
|
||||||
"flags": {},
|
"flags": {},
|
||||||
|
"comment": {
|
||||||
|
"shortText": "Schlechtenburg maintains a library of blocks that are available",
|
||||||
|
"tags": [
|
||||||
|
{
|
||||||
|
"tag": "internal",
|
||||||
|
"text": "\n"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
"sources": [
|
"sources": [
|
||||||
{
|
{
|
||||||
"fileName": "types.ts",
|
"fileName": "types.ts",
|
||||||
"line": 43,
|
"line": 170,
|
||||||
"character": 17
|
"character": 17
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
@ -406,6 +451,15 @@
|
||||||
"kind": 256,
|
"kind": 256,
|
||||||
"kindString": "Interface",
|
"kindString": "Interface",
|
||||||
"flags": {},
|
"flags": {},
|
||||||
|
"comment": {
|
||||||
|
"shortText": "Any Block that you create",
|
||||||
|
"tags": [
|
||||||
|
{
|
||||||
|
"tag": "see",
|
||||||
|
"text": "IBlockDefinition\n"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
"children": [
|
"children": [
|
||||||
{
|
{
|
||||||
"id": 42,
|
"id": 42,
|
||||||
|
@ -418,7 +472,7 @@
|
||||||
"sources": [
|
"sources": [
|
||||||
{
|
{
|
||||||
"fileName": "types.ts",
|
"fileName": "types.ts",
|
||||||
"line": 25,
|
"line": 142,
|
||||||
"character": 2
|
"character": 2
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
@ -438,7 +492,7 @@
|
||||||
"sources": [
|
"sources": [
|
||||||
{
|
{
|
||||||
"fileName": "types.ts",
|
"fileName": "types.ts",
|
||||||
"line": 26,
|
"line": 143,
|
||||||
"character": 2
|
"character": 2
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
@ -459,7 +513,7 @@
|
||||||
"sources": [
|
"sources": [
|
||||||
{
|
{
|
||||||
"fileName": "types.ts",
|
"fileName": "types.ts",
|
||||||
"line": 31,
|
"line": 148,
|
||||||
"character": 2
|
"character": 2
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
@ -480,7 +534,7 @@
|
||||||
"sources": [
|
"sources": [
|
||||||
{
|
{
|
||||||
"fileName": "types.ts",
|
"fileName": "types.ts",
|
||||||
"line": 32,
|
"line": 149,
|
||||||
"character": 2
|
"character": 2
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
@ -501,7 +555,7 @@
|
||||||
"sources": [
|
"sources": [
|
||||||
{
|
{
|
||||||
"fileName": "types.ts",
|
"fileName": "types.ts",
|
||||||
"line": 29,
|
"line": 146,
|
||||||
"character": 2
|
"character": 2
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
@ -522,7 +576,7 @@
|
||||||
"sources": [
|
"sources": [
|
||||||
{
|
{
|
||||||
"fileName": "types.ts",
|
"fileName": "types.ts",
|
||||||
"line": 28,
|
"line": 145,
|
||||||
"character": 2
|
"character": 2
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
@ -543,7 +597,7 @@
|
||||||
"sources": [
|
"sources": [
|
||||||
{
|
{
|
||||||
"fileName": "types.ts",
|
"fileName": "types.ts",
|
||||||
"line": 30,
|
"line": 147,
|
||||||
"character": 2
|
"character": 2
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
@ -564,13 +618,13 @@
|
||||||
"sources": [
|
"sources": [
|
||||||
{
|
{
|
||||||
"fileName": "types.ts",
|
"fileName": "types.ts",
|
||||||
"line": 27,
|
"line": 144,
|
||||||
"character": 2
|
"character": 2
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"type": {
|
"type": {
|
||||||
"type": "reference",
|
"type": "reference",
|
||||||
"id": 15,
|
"id": 19,
|
||||||
"typeArguments": [
|
"typeArguments": [
|
||||||
{
|
{
|
||||||
"type": "reference",
|
"type": "reference",
|
||||||
|
@ -601,7 +655,7 @@
|
||||||
"sources": [
|
"sources": [
|
||||||
{
|
{
|
||||||
"fileName": "types.ts",
|
"fileName": "types.ts",
|
||||||
"line": 24,
|
"line": 141,
|
||||||
"character": 17
|
"character": 17
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
@ -613,6 +667,15 @@
|
||||||
"kindString": "Type parameter",
|
"kindString": "Type parameter",
|
||||||
"flags": {}
|
"flags": {}
|
||||||
}
|
}
|
||||||
|
],
|
||||||
|
"typeParameters": [
|
||||||
|
{
|
||||||
|
"id": 50,
|
||||||
|
"name": "T",
|
||||||
|
"kind": 131072,
|
||||||
|
"kindString": "Type parameter",
|
||||||
|
"flags": {}
|
||||||
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -621,6 +684,15 @@
|
||||||
"kind": 256,
|
"kind": 256,
|
||||||
"kindString": "Interface",
|
"kindString": "Interface",
|
||||||
"flags": {},
|
"flags": {},
|
||||||
|
"comment": {
|
||||||
|
"shortText": "Schlechtenburg keeps track of the rendered block tree.\nThis is useful for e.g. the tree select component in the editor header.",
|
||||||
|
"tags": [
|
||||||
|
{
|
||||||
|
"tag": "internal",
|
||||||
|
"text": "\n"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
"children": [
|
"children": [
|
||||||
{
|
{
|
||||||
"id": 9,
|
"id": 9,
|
||||||
|
@ -631,7 +703,7 @@
|
||||||
"sources": [
|
"sources": [
|
||||||
{
|
{
|
||||||
"fileName": "types.ts",
|
"fileName": "types.ts",
|
||||||
"line": 7,
|
"line": 13,
|
||||||
"character": 2
|
"character": 2
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
@ -655,7 +727,7 @@
|
||||||
"sources": [
|
"sources": [
|
||||||
{
|
{
|
||||||
"fileName": "types.ts",
|
"fileName": "types.ts",
|
||||||
"line": 6,
|
"line": 12,
|
||||||
"character": 2
|
"character": 2
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
@ -673,7 +745,7 @@
|
||||||
"sources": [
|
"sources": [
|
||||||
{
|
{
|
||||||
"fileName": "types.ts",
|
"fileName": "types.ts",
|
||||||
"line": 4,
|
"line": 10,
|
||||||
"character": 2
|
"character": 2
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
@ -691,7 +763,7 @@
|
||||||
"sources": [
|
"sources": [
|
||||||
{
|
{
|
||||||
"fileName": "types.ts",
|
"fileName": "types.ts",
|
||||||
"line": 5,
|
"line": 11,
|
||||||
"character": 2
|
"character": 2
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
@ -716,7 +788,7 @@
|
||||||
"sources": [
|
"sources": [
|
||||||
{
|
{
|
||||||
"fileName": "types.ts",
|
"fileName": "types.ts",
|
||||||
"line": 3,
|
"line": 9,
|
||||||
"character": 17
|
"character": 17
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
@ -730,7 +802,7 @@
|
||||||
"sources": [
|
"sources": [
|
||||||
{
|
{
|
||||||
"fileName": "types.ts",
|
"fileName": "types.ts",
|
||||||
"line": 22,
|
"line": 134,
|
||||||
"character": 12
|
"character": 12
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
@ -745,7 +817,7 @@
|
||||||
"sources": [
|
"sources": [
|
||||||
{
|
{
|
||||||
"fileName": "types.ts",
|
"fileName": "types.ts",
|
||||||
"line": 22,
|
"line": 134,
|
||||||
"character": 32
|
"character": 32
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
@ -756,6 +828,16 @@
|
||||||
"kind": 4096,
|
"kind": 4096,
|
||||||
"kindString": "Call signature",
|
"kindString": "Call signature",
|
||||||
"flags": {},
|
"flags": {},
|
||||||
|
"comment": {
|
||||||
|
"shortText": "Callback type for activating the next block.",
|
||||||
|
"text": "```\nprops: {\n onActivateNext: {\n type: (null as unknown) as PropType<OnActivateNextCb>,\n default: () => {},\n },\n}\n```\n",
|
||||||
|
"tags": [
|
||||||
|
{
|
||||||
|
"tag": "see",
|
||||||
|
"text": "SbBlock\n"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
"type": {
|
"type": {
|
||||||
"type": "intrinsic",
|
"type": "intrinsic",
|
||||||
"name": "void"
|
"name": "void"
|
||||||
|
@ -774,7 +856,7 @@
|
||||||
"sources": [
|
"sources": [
|
||||||
{
|
{
|
||||||
"fileName": "types.ts",
|
"fileName": "types.ts",
|
||||||
"line": 21,
|
"line": 118,
|
||||||
"character": 12
|
"character": 12
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
@ -789,7 +871,7 @@
|
||||||
"sources": [
|
"sources": [
|
||||||
{
|
{
|
||||||
"fileName": "types.ts",
|
"fileName": "types.ts",
|
||||||
"line": 21,
|
"line": 118,
|
||||||
"character": 36
|
"character": 36
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
@ -800,6 +882,16 @@
|
||||||
"kind": 4096,
|
"kind": 4096,
|
||||||
"kindString": "Call signature",
|
"kindString": "Call signature",
|
||||||
"flags": {},
|
"flags": {},
|
||||||
|
"comment": {
|
||||||
|
"shortText": "Callback type for activating the previous block.",
|
||||||
|
"text": "```\nprops: {\n onActivatePrevious: {\n type: (null as unknown) as PropType<OnActivatePreviousCb>,\n default: () => {},\n },\n}\n```\n",
|
||||||
|
"tags": [
|
||||||
|
{
|
||||||
|
"tag": "see",
|
||||||
|
"text": "SbBlock\n"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
"type": {
|
"type": {
|
||||||
"type": "intrinsic",
|
"type": "intrinsic",
|
||||||
"name": "void"
|
"name": "void"
|
||||||
|
@ -818,7 +910,7 @@
|
||||||
"sources": [
|
"sources": [
|
||||||
{
|
{
|
||||||
"fileName": "types.ts",
|
"fileName": "types.ts",
|
||||||
"line": 19,
|
"line": 86,
|
||||||
"character": 12
|
"character": 12
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
@ -833,7 +925,7 @@
|
||||||
"sources": [
|
"sources": [
|
||||||
{
|
{
|
||||||
"fileName": "types.ts",
|
"fileName": "types.ts",
|
||||||
"line": 19,
|
"line": 86,
|
||||||
"character": 31
|
"character": 31
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
@ -844,6 +936,16 @@
|
||||||
"kind": 4096,
|
"kind": 4096,
|
||||||
"kindString": "Call signature",
|
"kindString": "Call signature",
|
||||||
"flags": {},
|
"flags": {},
|
||||||
|
"comment": {
|
||||||
|
"shortText": "Callback type for sending blocks that should be appended as a sibling after the current block",
|
||||||
|
"text": "```\nprops: {\n onAppendBlock: {\n type: (null as unknown) as PropType<OnAppendBlockCb<IComponentToBeAppendedData>>,\n default: () => {},\n },\n}\n```\n",
|
||||||
|
"tags": [
|
||||||
|
{
|
||||||
|
"tag": "see",
|
||||||
|
"text": "SbBlock\n"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
"parameters": [
|
"parameters": [
|
||||||
{
|
{
|
||||||
"id": 31,
|
"id": 31,
|
||||||
|
@ -882,7 +984,7 @@
|
||||||
"sources": [
|
"sources": [
|
||||||
{
|
{
|
||||||
"fileName": "types.ts",
|
"fileName": "types.ts",
|
||||||
"line": 18,
|
"line": 70,
|
||||||
"character": 12
|
"character": 12
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
@ -897,7 +999,7 @@
|
||||||
"sources": [
|
"sources": [
|
||||||
{
|
{
|
||||||
"fileName": "types.ts",
|
"fileName": "types.ts",
|
||||||
"line": 18,
|
"line": 70,
|
||||||
"character": 32
|
"character": 32
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
@ -908,6 +1010,16 @@
|
||||||
"kind": 4096,
|
"kind": 4096,
|
||||||
"kindString": "Call signature",
|
"kindString": "Call signature",
|
||||||
"flags": {},
|
"flags": {},
|
||||||
|
"comment": {
|
||||||
|
"shortText": "Callback type for sending blocks that should be prepended as a sibling before the current block",
|
||||||
|
"text": "```\nprops: {\n onPrependBlock: {\n type: (null as unknown) as PropType<OnPrependBlockCb<IComponentToBePrependedData>>,\n default: () => {},\n },\n}\n```\n",
|
||||||
|
"tags": [
|
||||||
|
{
|
||||||
|
"tag": "see",
|
||||||
|
"text": "SbBlock\n"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
"parameters": [
|
"parameters": [
|
||||||
{
|
{
|
||||||
"id": 27,
|
"id": 27,
|
||||||
|
@ -946,7 +1058,7 @@
|
||||||
"sources": [
|
"sources": [
|
||||||
{
|
{
|
||||||
"fileName": "types.ts",
|
"fileName": "types.ts",
|
||||||
"line": 20,
|
"line": 102,
|
||||||
"character": 12
|
"character": 12
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
@ -961,7 +1073,7 @@
|
||||||
"sources": [
|
"sources": [
|
||||||
{
|
{
|
||||||
"fileName": "types.ts",
|
"fileName": "types.ts",
|
||||||
"line": 20,
|
"line": 102,
|
||||||
"character": 30
|
"character": 30
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
@ -972,6 +1084,16 @@
|
||||||
"kind": 4096,
|
"kind": 4096,
|
||||||
"kindString": "Call signature",
|
"kindString": "Call signature",
|
||||||
"flags": {},
|
"flags": {},
|
||||||
|
"comment": {
|
||||||
|
"shortText": "Callback type for removing the current block.",
|
||||||
|
"text": "```\nprops: {\n onRemoveSelf: {\n type: (null as unknown) as PropType<OnRemoveSelfCb>,\n default: () => {},\n },\n}\n```\n",
|
||||||
|
"tags": [
|
||||||
|
{
|
||||||
|
"tag": "see",
|
||||||
|
"text": "SbBlock\n"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
"type": {
|
"type": {
|
||||||
"type": "intrinsic",
|
"type": "intrinsic",
|
||||||
"name": "void"
|
"name": "void"
|
||||||
|
@ -982,7 +1104,7 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 20,
|
"id": 15,
|
||||||
"name": "OnUpdateBlockCb",
|
"name": "OnUpdateBlockCb",
|
||||||
"kind": 4194304,
|
"kind": 4194304,
|
||||||
"kindString": "Type alias",
|
"kindString": "Type alias",
|
||||||
|
@ -990,14 +1112,14 @@
|
||||||
"sources": [
|
"sources": [
|
||||||
{
|
{
|
||||||
"fileName": "types.ts",
|
"fileName": "types.ts",
|
||||||
"line": 17,
|
"line": 38,
|
||||||
"character": 12
|
"character": 12
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"type": {
|
"type": {
|
||||||
"type": "reflection",
|
"type": "reflection",
|
||||||
"declaration": {
|
"declaration": {
|
||||||
"id": 21,
|
"id": 16,
|
||||||
"name": "__type",
|
"name": "__type",
|
||||||
"kind": 65536,
|
"kind": 65536,
|
||||||
"kindString": "Type literal",
|
"kindString": "Type literal",
|
||||||
|
@ -1005,20 +1127,30 @@
|
||||||
"sources": [
|
"sources": [
|
||||||
{
|
{
|
||||||
"fileName": "types.ts",
|
"fileName": "types.ts",
|
||||||
"line": 17,
|
"line": 38,
|
||||||
"character": 30
|
"character": 30
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"signatures": [
|
"signatures": [
|
||||||
{
|
{
|
||||||
"id": 22,
|
"id": 17,
|
||||||
"name": "__type",
|
"name": "__type",
|
||||||
"kind": 4096,
|
"kind": 4096,
|
||||||
"kindString": "Call signature",
|
"kindString": "Call signature",
|
||||||
"flags": {},
|
"flags": {},
|
||||||
|
"comment": {
|
||||||
|
"shortText": "Callback type for sending full block updates. SbBlock takes this as a prop.",
|
||||||
|
"text": "```\n<SbBlock onUpdate={myFn as OnUpdateSelfCb}></SbBlock>\n```\n",
|
||||||
|
"tags": [
|
||||||
|
{
|
||||||
|
"tag": "see",
|
||||||
|
"text": "SbBlock\n"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
"parameters": [
|
"parameters": [
|
||||||
{
|
{
|
||||||
"id": 23,
|
"id": 18,
|
||||||
"name": "updated",
|
"name": "updated",
|
||||||
"kind": 32768,
|
"kind": 32768,
|
||||||
"kindString": "Parameter",
|
"kindString": "Parameter",
|
||||||
|
@ -1046,7 +1178,7 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 15,
|
"id": 19,
|
||||||
"name": "OnUpdateSelfCb",
|
"name": "OnUpdateSelfCb",
|
||||||
"kind": 4194304,
|
"kind": 4194304,
|
||||||
"kindString": "Type alias",
|
"kindString": "Type alias",
|
||||||
|
@ -1054,13 +1186,13 @@
|
||||||
"sources": [
|
"sources": [
|
||||||
{
|
{
|
||||||
"fileName": "types.ts",
|
"fileName": "types.ts",
|
||||||
"line": 16,
|
"line": 54,
|
||||||
"character": 12
|
"character": 12
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"typeParameter": [
|
"typeParameter": [
|
||||||
{
|
{
|
||||||
"id": 19,
|
"id": 23,
|
||||||
"name": "T",
|
"name": "T",
|
||||||
"kind": 131072,
|
"kind": 131072,
|
||||||
"kindString": "Type parameter",
|
"kindString": "Type parameter",
|
||||||
|
@ -1070,7 +1202,7 @@
|
||||||
"type": {
|
"type": {
|
||||||
"type": "reflection",
|
"type": "reflection",
|
||||||
"declaration": {
|
"declaration": {
|
||||||
"id": 16,
|
"id": 20,
|
||||||
"name": "__type",
|
"name": "__type",
|
||||||
"kind": 65536,
|
"kind": 65536,
|
||||||
"kindString": "Type literal",
|
"kindString": "Type literal",
|
||||||
|
@ -1078,20 +1210,30 @@
|
||||||
"sources": [
|
"sources": [
|
||||||
{
|
{
|
||||||
"fileName": "types.ts",
|
"fileName": "types.ts",
|
||||||
"line": 16,
|
"line": 54,
|
||||||
"character": 32
|
"character": 32
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"signatures": [
|
"signatures": [
|
||||||
{
|
{
|
||||||
"id": 17,
|
"id": 21,
|
||||||
"name": "__type",
|
"name": "__type",
|
||||||
"kind": 4096,
|
"kind": 4096,
|
||||||
"kindString": "Call signature",
|
"kindString": "Call signature",
|
||||||
"flags": {},
|
"flags": {},
|
||||||
|
"comment": {
|
||||||
|
"shortText": "Callback type for sending partial self-updates in edit mode.",
|
||||||
|
"text": "```\nprops: {\n onUpdate: {\n type: (null as unknown) as PropType<OnUpdateSelfCb<IYourComponentData>>,\n default: () => {},\n },\n}\n```\n",
|
||||||
|
"tags": [
|
||||||
|
{
|
||||||
|
"tag": "see",
|
||||||
|
"text": "SbBlock\n"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
"parameters": [
|
"parameters": [
|
||||||
{
|
{
|
||||||
"id": 18,
|
"id": 22,
|
||||||
"name": "updated",
|
"name": "updated",
|
||||||
"kind": 32768,
|
"kind": 32768,
|
||||||
"kindString": "Parameter",
|
"kindString": "Parameter",
|
||||||
|
@ -1101,7 +1243,7 @@
|
||||||
"typeArguments": [
|
"typeArguments": [
|
||||||
{
|
{
|
||||||
"type": "reference",
|
"type": "reference",
|
||||||
"id": 19,
|
"id": 23,
|
||||||
"name": "T"
|
"name": "T"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
@ -1118,7 +1260,16 @@
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"typeParameters": [
|
||||||
|
{
|
||||||
|
"id": 23,
|
||||||
|
"name": "T",
|
||||||
|
"kind": 131072,
|
||||||
|
"kindString": "Type parameter",
|
||||||
|
"flags": {}
|
||||||
}
|
}
|
||||||
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 4,
|
"id": 4,
|
||||||
|
@ -1711,7 +1862,7 @@
|
||||||
"typeArguments": [
|
"typeArguments": [
|
||||||
{
|
{
|
||||||
"type": "reference",
|
"type": "reference",
|
||||||
"id": 20,
|
"id": 15,
|
||||||
"name": "OnUpdateBlockCb"
|
"name": "OnUpdateBlockCb"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
@ -1942,7 +2093,7 @@
|
||||||
"flags": {},
|
"flags": {},
|
||||||
"type": {
|
"type": {
|
||||||
"type": "reference",
|
"type": "reference",
|
||||||
"id": 20,
|
"id": 15,
|
||||||
"name": "OnUpdateBlockCb"
|
"name": "OnUpdateBlockCb"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2058,7 +2209,7 @@
|
||||||
"flags": {},
|
"flags": {},
|
||||||
"type": {
|
"type": {
|
||||||
"type": "reference",
|
"type": "reference",
|
||||||
"id": 20,
|
"id": 15,
|
||||||
"name": "OnUpdateBlockCb"
|
"name": "OnUpdateBlockCb"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -5514,8 +5665,8 @@
|
||||||
28,
|
28,
|
||||||
24,
|
24,
|
||||||
32,
|
32,
|
||||||
20,
|
15,
|
||||||
15
|
19
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,5 +1,11 @@
|
||||||
import { Component } from 'vue';
|
import { Component } from 'vue';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Schlechtenburg keeps track of the rendered block tree.
|
||||||
|
* This is useful for e.g. the tree select component in the editor header.
|
||||||
|
*
|
||||||
|
* @internal
|
||||||
|
*/
|
||||||
export interface ITreeNode {
|
export interface ITreeNode {
|
||||||
id: string;
|
id: string;
|
||||||
name: string;
|
name: string;
|
||||||
|
@ -7,20 +13,131 @@ export interface ITreeNode {
|
||||||
children: ITreeNode[];
|
children: ITreeNode[];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Schlechtenburg inputs and outputs a plain JS Object that can be JSON stringified. This is the
|
||||||
|
* interface type for that data structure. <T> will be the data type of the specific block being
|
||||||
|
*
|
||||||
|
* @see SbMain
|
||||||
|
*/
|
||||||
export interface IBlockData<T> {
|
export interface IBlockData<T> {
|
||||||
id: string;
|
id: string;
|
||||||
name: string;
|
name: string;
|
||||||
data: T;
|
data: T;
|
||||||
}
|
}
|
||||||
|
|
||||||
export type OnUpdateSelfCb<T> = (updated: Partial<T>) => void;
|
|
||||||
|
/**
|
||||||
|
* Callback type for sending full block updates. SbBlock takes this as a prop.
|
||||||
|
*
|
||||||
|
* ```
|
||||||
|
* <SbBlock onUpdate={myFn as OnUpdateSelfCb}></SbBlock>
|
||||||
|
* ```
|
||||||
|
*
|
||||||
|
* @see SbBlock
|
||||||
|
*/
|
||||||
export type OnUpdateBlockCb = (updated: IBlockData<any>) => void;
|
export type OnUpdateBlockCb = (updated: IBlockData<any>) => void;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Callback type for sending partial self-updates in edit mode.
|
||||||
|
*
|
||||||
|
* ```
|
||||||
|
* props: {
|
||||||
|
* onUpdate: {
|
||||||
|
* type: (null as unknown) as PropType<OnUpdateSelfCb<IYourComponentData>>,
|
||||||
|
* default: () => {},
|
||||||
|
* },
|
||||||
|
* }
|
||||||
|
* ```
|
||||||
|
*
|
||||||
|
* @see SbBlock
|
||||||
|
*/
|
||||||
|
export type OnUpdateSelfCb<T> = (updated: Partial<T>) => void;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Callback type for sending blocks that should be prepended as a sibling before the current block
|
||||||
|
*
|
||||||
|
* ```
|
||||||
|
* props: {
|
||||||
|
* onPrependBlock: {
|
||||||
|
* type: (null as unknown) as PropType<OnPrependBlockCb<IComponentToBePrependedData>>,
|
||||||
|
* default: () => {},
|
||||||
|
* },
|
||||||
|
* }
|
||||||
|
* ```
|
||||||
|
*
|
||||||
|
* @see SbBlock
|
||||||
|
*/
|
||||||
export type OnPrependBlockCb = (block: IBlockData<any>) => void;
|
export type OnPrependBlockCb = (block: IBlockData<any>) => void;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Callback type for sending blocks that should be appended as a sibling after the current block
|
||||||
|
*
|
||||||
|
* ```
|
||||||
|
* props: {
|
||||||
|
* onAppendBlock: {
|
||||||
|
* type: (null as unknown) as PropType<OnAppendBlockCb<IComponentToBeAppendedData>>,
|
||||||
|
* default: () => {},
|
||||||
|
* },
|
||||||
|
* }
|
||||||
|
* ```
|
||||||
|
*
|
||||||
|
* @see SbBlock
|
||||||
|
*/
|
||||||
export type OnAppendBlockCb = (block: IBlockData<any>) => void;
|
export type OnAppendBlockCb = (block: IBlockData<any>) => void;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Callback type for removing the current block.
|
||||||
|
*
|
||||||
|
* ```
|
||||||
|
* props: {
|
||||||
|
* onRemoveSelf: {
|
||||||
|
* type: (null as unknown) as PropType<OnRemoveSelfCb>,
|
||||||
|
* default: () => {},
|
||||||
|
* },
|
||||||
|
* }
|
||||||
|
* ```
|
||||||
|
*
|
||||||
|
* @see SbBlock
|
||||||
|
*/
|
||||||
export type OnRemoveSelfCb = () => void;
|
export type OnRemoveSelfCb = () => void;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Callback type for activating the previous block.
|
||||||
|
*
|
||||||
|
* ```
|
||||||
|
* props: {
|
||||||
|
* onActivatePrevious: {
|
||||||
|
* type: (null as unknown) as PropType<OnActivatePreviousCb>,
|
||||||
|
* default: () => {},
|
||||||
|
* },
|
||||||
|
* }
|
||||||
|
* ```
|
||||||
|
*
|
||||||
|
* @see SbBlock
|
||||||
|
*/
|
||||||
export type OnActivatePreviousCb = () => void;
|
export type OnActivatePreviousCb = () => void;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Callback type for activating the next block.
|
||||||
|
*
|
||||||
|
* ```
|
||||||
|
* props: {
|
||||||
|
* onActivateNext: {
|
||||||
|
* type: (null as unknown) as PropType<OnActivateNextCb>,
|
||||||
|
* default: () => {},
|
||||||
|
* },
|
||||||
|
* }
|
||||||
|
* ```
|
||||||
|
*
|
||||||
|
* @see SbBlock
|
||||||
|
*/
|
||||||
export type OnActivateNextCb = () => void;
|
export type OnActivateNextCb = () => void;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Any Block that you create
|
||||||
|
*
|
||||||
|
* @see IBlockDefinition
|
||||||
|
*/
|
||||||
export interface IBlockProps<T> {
|
export interface IBlockProps<T> {
|
||||||
blockId?: string;
|
blockId?: string;
|
||||||
data?: T,
|
data?: T,
|
||||||
|
@ -32,6 +149,11 @@ export interface IBlockProps<T> {
|
||||||
onActivatePrevious?: OnActivatePreviousCb;
|
onActivatePrevious?: OnActivatePreviousCb;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Any Block that you create
|
||||||
|
*
|
||||||
|
* @see IBlockProps
|
||||||
|
*/
|
||||||
export interface IBlockDefinition<T> {
|
export interface IBlockDefinition<T> {
|
||||||
name: string;
|
name: string;
|
||||||
icon?: string;
|
icon?: string;
|
||||||
|
@ -40,6 +162,11 @@ export interface IBlockDefinition<T> {
|
||||||
display: Component<IBlockProps<T>>;
|
display: Component<IBlockProps<T>>;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Schlechtenburg maintains a library of blocks that are available
|
||||||
|
*
|
||||||
|
* @internal
|
||||||
|
*/
|
||||||
export interface IBlockLibrary {
|
export interface IBlockLibrary {
|
||||||
[name: string]: IBlockDefinition<any>;
|
[name: string]: IBlockDefinition<any>;
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,18 +4,30 @@ import { parse } from 'vue-docgen-api'
|
||||||
import { join } from 'path'
|
import { join } from 'path'
|
||||||
import glob from 'glob-promise'
|
import glob from 'glob-promise'
|
||||||
import TypeDoc from 'typedoc'
|
import TypeDoc from 'typedoc'
|
||||||
import { writeFile } from 'fs/promises'
|
import { writeFile, readFile } from 'fs/promises'
|
||||||
|
|
||||||
const DOCS_PATH = join(process.cwd(), process.argv[2] || './docs');
|
const DOCS_PATH = join(process.cwd(), process.argv[2] || './docs');
|
||||||
const LIB_PATH = join(process.cwd(), process.argv[3] || './lib');
|
const LIB_PATH = join(process.cwd(), process.argv[3] || './lib');
|
||||||
|
|
||||||
const getTSDocs = (outputFile) => {
|
const transformTSDocs = (docs) => {
|
||||||
|
return {
|
||||||
|
...docs,
|
||||||
|
children: docs.children.map(child => ({
|
||||||
|
...child,
|
||||||
|
typeParameters: child.typeParameter,
|
||||||
|
})),
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
const getTSDocs = async (outputFile) => {
|
||||||
const app = new TypeDoc.Application();
|
const app = new TypeDoc.Application();
|
||||||
app.options.addReader(new TypeDoc.TSConfigReader());
|
app.options.addReader(new TypeDoc.TSConfigReader());
|
||||||
|
|
||||||
app.bootstrap();
|
app.bootstrap();
|
||||||
const project = app.convert();
|
const project = app.convert();
|
||||||
return app.generateJson(project, outputFile);
|
await app.generateJson(project, outputFile);
|
||||||
|
const data = JSON.parse(await readFile(outputFile));
|
||||||
|
await writeFile(outputFile, JSON.stringify(transformTSDocs(data), null, 2))
|
||||||
};
|
};
|
||||||
|
|
||||||
const getVueComponentDocs = async (dir) => {
|
const getVueComponentDocs = async (dir) => {
|
||||||
|
@ -37,11 +49,17 @@ const getVueComponentDocs = async (dir) => {
|
||||||
};
|
};
|
||||||
|
|
||||||
(async () => {
|
(async () => {
|
||||||
|
await Promise.all([
|
||||||
|
(() => {
|
||||||
const tsDocsOutput = join(DOCS_PATH, 'lib.json');
|
const tsDocsOutput = join(DOCS_PATH, 'lib.json');
|
||||||
await getTSDocs(tsDocsOutput);
|
return getTSDocs(tsDocsOutput);
|
||||||
|
})(),
|
||||||
|
|
||||||
|
(async () => {
|
||||||
const vueComponents = await getVueComponentDocs(LIB_PATH);
|
const vueComponents = await getVueComponentDocs(LIB_PATH);
|
||||||
const componentJsonPath = join(DOCS_PATH, 'components.json');
|
const componentJsonPath = join(DOCS_PATH, 'components.json');
|
||||||
console.log(`Info: JSON written to ${componentJsonPath}`);
|
console.log(`Info: JSON written to ${componentJsonPath}`);
|
||||||
await writeFile(componentJsonPath, JSON.stringify(vueComponents, null, 2));
|
return writeFile(componentJsonPath, JSON.stringify(vueComponents, null, 2));
|
||||||
|
})(),
|
||||||
|
])
|
||||||
})();
|
})();
|
||||||
|
|
|
@ -2,7 +2,7 @@ import {
|
||||||
defineComponent,
|
defineComponent,
|
||||||
} from 'vue';
|
} from 'vue';
|
||||||
import { RouterView } from 'vue-router';
|
import { RouterView } from 'vue-router';
|
||||||
import SideMenu from './Sidemenu';
|
import SideMenu from './sidemenu/Sidemenu';
|
||||||
|
|
||||||
import './App.scss';
|
import './App.scss';
|
||||||
|
|
||||||
|
|
25
packages/docs/lib/ComponentDocs.tsx
Normal file
25
packages/docs/lib/ComponentDocs.tsx
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
import {
|
||||||
|
defineComponent,
|
||||||
|
PropType,
|
||||||
|
} from 'vue';
|
||||||
|
import { ComponentDoc } from 'vue-docgen-api';
|
||||||
|
|
||||||
|
import './ComponentDocs.scss';
|
||||||
|
|
||||||
|
export default defineComponent({
|
||||||
|
name: 'ComponentDocs',
|
||||||
|
|
||||||
|
props: {
|
||||||
|
docs: {
|
||||||
|
type: (null as unknown) as PropType<ComponentDoc>,
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
setup(props) {
|
||||||
|
const docs = props.docs;
|
||||||
|
return () => <section class="docs component-docs">
|
||||||
|
<h2 id={docs.exportName}>{docs.exportName}</h2>
|
||||||
|
</section>;
|
||||||
|
},
|
||||||
|
});
|
|
@ -1,12 +0,0 @@
|
||||||
import { defineComponent } from 'vue';
|
|
||||||
|
|
||||||
import './Sidemenu.scss';
|
|
||||||
|
|
||||||
export default defineComponent({
|
|
||||||
name: 'Sidemenu',
|
|
||||||
|
|
||||||
setup() {
|
|
||||||
return () => <div class="sidemenu">
|
|
||||||
</div>;
|
|
||||||
},
|
|
||||||
});
|
|
36
packages/docs/lib/TsDocs.tsx
Normal file
36
packages/docs/lib/TsDocs.tsx
Normal file
|
@ -0,0 +1,36 @@
|
||||||
|
import {
|
||||||
|
defineComponent,
|
||||||
|
PropType,
|
||||||
|
} from 'vue';
|
||||||
|
import {
|
||||||
|
DeclarationReflection,
|
||||||
|
TypeParameterReflection,
|
||||||
|
} from 'typedoc';
|
||||||
|
|
||||||
|
import './TsDocs.scss';
|
||||||
|
|
||||||
|
const getTypeParamString = (params: TypeParameterReflection[]) => `<${params.map(p => p.name).join(', ')}>`;
|
||||||
|
|
||||||
|
export default defineComponent({
|
||||||
|
name: 'TsDocs',
|
||||||
|
|
||||||
|
props: {
|
||||||
|
docs: {
|
||||||
|
type: (null as unknown) as PropType<DeclarationReflection>,
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
setup(props) {
|
||||||
|
const docs = props.docs;
|
||||||
|
console.log(docs);
|
||||||
|
return () => <section class="docs ts-docs">
|
||||||
|
<h2 id={docs.name}>
|
||||||
|
{docs.name}
|
||||||
|
{docs.typeParameters ? getTypeParamString(docs.typeParameters) : ''}
|
||||||
|
</h2>
|
||||||
|
<p>{docs.kindString}</p>
|
||||||
|
<p>{docs.comment}</p>
|
||||||
|
</section>;
|
||||||
|
},
|
||||||
|
});
|
|
@ -1,9 +1,23 @@
|
||||||
import { ComponentDoc } from 'vue-docgen-api';
|
import { ComponentDoc } from 'vue-docgen-api';
|
||||||
import { ProjectReflection } from 'typedoc';
|
import { ProjectReflection } from 'typedoc';
|
||||||
|
|
||||||
|
import { getShortPackageName } from './package';
|
||||||
|
|
||||||
import coreComponents from '@schlechtenburg/core/docs/components.json';
|
import coreComponents from '@schlechtenburg/core/docs/components.json';
|
||||||
import coreLib from '@schlechtenburg/core/docs/lib.json';
|
import coreLib from '@schlechtenburg/core/docs/lib.json';
|
||||||
|
|
||||||
|
import layoutComponents from '@schlechtenburg/layout/docs/components.json';
|
||||||
|
import layoutLib from '@schlechtenburg/layout/docs/lib.json';
|
||||||
|
|
||||||
|
import headingComponents from '@schlechtenburg/heading/docs/components.json';
|
||||||
|
import headingLib from '@schlechtenburg/heading/docs/lib.json';
|
||||||
|
|
||||||
|
import paragraphComponents from '@schlechtenburg/paragraph/docs/components.json';
|
||||||
|
import paragraphLib from '@schlechtenburg/paragraph/docs/lib.json';
|
||||||
|
|
||||||
|
import imageComponents from '@schlechtenburg/image/docs/components.json';
|
||||||
|
import imageLib from '@schlechtenburg/image/docs/lib.json';
|
||||||
|
|
||||||
export interface IDocs {
|
export interface IDocs {
|
||||||
components: ComponentDoc;
|
components: ComponentDoc;
|
||||||
lib: ProjectReflection;
|
lib: ProjectReflection;
|
||||||
|
@ -12,4 +26,33 @@ export interface IDocs {
|
||||||
export const core = {
|
export const core = {
|
||||||
lib: coreLib,
|
lib: coreLib,
|
||||||
components: coreComponents,
|
components: coreComponents,
|
||||||
};
|
} as unknown as IDocs;
|
||||||
|
|
||||||
|
export const layout = {
|
||||||
|
lib: layoutLib,
|
||||||
|
components: layoutComponents,
|
||||||
|
} as unknown as IDocs;
|
||||||
|
|
||||||
|
export const heading = {
|
||||||
|
lib: headingLib,
|
||||||
|
components: headingComponents,
|
||||||
|
} as unknown as IDocs;
|
||||||
|
|
||||||
|
export const paragraph = {
|
||||||
|
lib: paragraphLib,
|
||||||
|
components: paragraphComponents,
|
||||||
|
} as unknown as IDocs;
|
||||||
|
|
||||||
|
export const image = {
|
||||||
|
lib: imageLib,
|
||||||
|
components: imageComponents,
|
||||||
|
} as unknown as IDocs;
|
||||||
|
|
||||||
|
export const getByName = (name: string) => ({
|
||||||
|
core,
|
||||||
|
layout,
|
||||||
|
heading,
|
||||||
|
paragraph,
|
||||||
|
image,
|
||||||
|
})[name];
|
||||||
|
|
||||||
|
|
|
@ -7,6 +7,13 @@ import './main.scss';
|
||||||
const router = createRouter({
|
const router = createRouter({
|
||||||
routes,
|
routes,
|
||||||
history: createWebHistory(),
|
history: createWebHistory(),
|
||||||
|
scrollBehavior(to) {
|
||||||
|
if (to.hash) {
|
||||||
|
return { el: to.hash };
|
||||||
|
}
|
||||||
|
|
||||||
|
return { top: 0 };
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
const app = createApp(App);
|
const app = createApp(App);
|
||||||
|
|
5
packages/docs/lib/package.ts
Normal file
5
packages/docs/lib/package.ts
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
export const getShortPackageName = (name: string) => {
|
||||||
|
const parts = name.split('/');
|
||||||
|
console.log(parts);
|
||||||
|
return parts[1] || parts[0] || name;
|
||||||
|
}
|
0
packages/docs/lib/pages/Introduction.scss
Normal file
0
packages/docs/lib/pages/Introduction.scss
Normal file
0
packages/docs/lib/pages/Package.scss
Normal file
0
packages/docs/lib/pages/Package.scss
Normal file
38
packages/docs/lib/pages/Package.tsx
Normal file
38
packages/docs/lib/pages/Package.tsx
Normal file
|
@ -0,0 +1,38 @@
|
||||||
|
import { defineComponent } from 'vue';
|
||||||
|
import { useRoute } from 'vue-router';
|
||||||
|
import { ComponentDoc } from 'vue-docgen-api';
|
||||||
|
import { DeclarationReflection } from 'typedoc';
|
||||||
|
|
||||||
|
import { getByName } from '../docs';
|
||||||
|
import ComponentDocs from '../ComponentDocs';
|
||||||
|
import TsDocs from '../TsDocs';
|
||||||
|
|
||||||
|
import './Package.scss';
|
||||||
|
|
||||||
|
export default defineComponent({
|
||||||
|
name: 'Package',
|
||||||
|
|
||||||
|
setup() {
|
||||||
|
const route = useRoute();
|
||||||
|
const packageName = route.params.package;
|
||||||
|
const docs = getByName(Array.isArray(packageName) ? packageName[0] : packageName);
|
||||||
|
if (!docs) {
|
||||||
|
return () => <div>Unknown package name {packageName}</div>
|
||||||
|
}
|
||||||
|
|
||||||
|
const { lib, components } = docs;
|
||||||
|
return () => <main class="package">
|
||||||
|
<h1>{lib.name}</h1>
|
||||||
|
<p>{lib.comment}</p>
|
||||||
|
<p>{lib.flags}</p>
|
||||||
|
{...(lib.children || []).map((child:DeclarationReflection) => {
|
||||||
|
const componentDocs = components.find((c: ComponentDoc) => c.exportName === child.name);
|
||||||
|
if (componentDocs) {
|
||||||
|
return <ComponentDocs docs={componentDocs}></ComponentDocs>
|
||||||
|
}
|
||||||
|
|
||||||
|
return <TsDocs docs={child}></TsDocs>
|
||||||
|
})}
|
||||||
|
</main>;
|
||||||
|
},
|
||||||
|
});
|
|
@ -1,11 +1,13 @@
|
||||||
|
|
||||||
export default [
|
export default [
|
||||||
{
|
{
|
||||||
|
name: 'home',
|
||||||
path: '/',
|
path: '/',
|
||||||
component: () => import('./Introduction').then(d => d.default),
|
component: () => import('./pages/Introduction').then(d => d.default),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/example',
|
name: 'package',
|
||||||
component: () => import('./Example').then(d => d.default),
|
path: '/@schlechtenburg/:package',
|
||||||
|
component: () => import('./pages/Package').then(d => d.default),
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
|
0
packages/docs/lib/sidemenu/Sidemenu.scss
Normal file
0
packages/docs/lib/sidemenu/Sidemenu.scss
Normal file
25
packages/docs/lib/sidemenu/Sidemenu.tsx
Normal file
25
packages/docs/lib/sidemenu/Sidemenu.tsx
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
import { defineComponent } from 'vue';
|
||||||
|
import {
|
||||||
|
core,
|
||||||
|
layout,
|
||||||
|
heading,
|
||||||
|
paragraph,
|
||||||
|
image,
|
||||||
|
} from '../docs';
|
||||||
|
import SidemenuPackage from './SidemenuPackage';
|
||||||
|
|
||||||
|
import './Sidemenu.scss';
|
||||||
|
|
||||||
|
export default defineComponent({
|
||||||
|
name: 'Sidemenu',
|
||||||
|
|
||||||
|
setup() {
|
||||||
|
return () => <div class="sidemenu">
|
||||||
|
<SidemenuPackage package={core}></SidemenuPackage>
|
||||||
|
<SidemenuPackage package={layout}></SidemenuPackage>
|
||||||
|
<SidemenuPackage package={heading}></SidemenuPackage>
|
||||||
|
<SidemenuPackage package={paragraph}></SidemenuPackage>
|
||||||
|
<SidemenuPackage package={image}></SidemenuPackage>
|
||||||
|
</div>;
|
||||||
|
},
|
||||||
|
});
|
38
packages/docs/lib/sidemenu/SidemenuPackage.tsx
Normal file
38
packages/docs/lib/sidemenu/SidemenuPackage.tsx
Normal file
|
@ -0,0 +1,38 @@
|
||||||
|
import {
|
||||||
|
defineComponent,
|
||||||
|
PropType,
|
||||||
|
} from 'vue';
|
||||||
|
import { RouterLink } from 'vue-router';
|
||||||
|
import { getShortPackageName } from '../package';
|
||||||
|
import { IDocs } from '../docs';
|
||||||
|
|
||||||
|
export default defineComponent({
|
||||||
|
name: 'Sidemenu',
|
||||||
|
|
||||||
|
props: {
|
||||||
|
package: {
|
||||||
|
type: (null as unknown) as PropType<IDocs>,
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
setup(props) {
|
||||||
|
const { lib, components } = props.package;
|
||||||
|
const shortName = getShortPackageName(lib.name);
|
||||||
|
return () => <div class="sidemenu-package">
|
||||||
|
<RouterLink to={{
|
||||||
|
name: 'package',
|
||||||
|
params: { package: shortName },
|
||||||
|
}}>{lib.name}</RouterLink>
|
||||||
|
<ul>
|
||||||
|
{...(lib.children || []).map(child => <li>
|
||||||
|
<RouterLink to={{
|
||||||
|
name: 'package',
|
||||||
|
params: { package: shortName },
|
||||||
|
hash: '#' + child.name,
|
||||||
|
}}>{child.name}</RouterLink>
|
||||||
|
</li>)}
|
||||||
|
</ul>
|
||||||
|
</div>;
|
||||||
|
},
|
||||||
|
});
|
77
packages/docs/package-lock.json
generated
77
packages/docs/package-lock.json
generated
|
@ -431,6 +431,12 @@
|
||||||
"minimist": "^1.2.0"
|
"minimist": "^1.2.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"@cush/relative": {
|
||||||
|
"version": "1.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/@cush/relative/-/relative-1.0.0.tgz",
|
||||||
|
"integrity": "sha512-RpfLEtTlyIxeNPGKcokS+p3BZII/Q3bYxryFRglh5H3A3T8q9fsLYm72VYAMEOOIBLEa8o93kFLiBDUWKrwXZA==",
|
||||||
|
"dev": true
|
||||||
|
},
|
||||||
"@intlify/core": {
|
"@intlify/core": {
|
||||||
"version": "9.0.0",
|
"version": "9.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/@intlify/core/-/core-9.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/@intlify/core/-/core-9.0.0.tgz",
|
||||||
|
@ -1171,6 +1177,12 @@
|
||||||
"@types/istanbul-lib-report": "*"
|
"@types/istanbul-lib-report": "*"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"@types/json5": {
|
||||||
|
"version": "0.0.29",
|
||||||
|
"resolved": "https://registry.npmjs.org/@types/json5/-/json5-0.0.29.tgz",
|
||||||
|
"integrity": "sha1-7ihweulOEdK4J7y+UnC86n8+ce4=",
|
||||||
|
"dev": true
|
||||||
|
},
|
||||||
"@types/micromatch": {
|
"@types/micromatch": {
|
||||||
"version": "4.0.1",
|
"version": "4.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/@types/micromatch/-/micromatch-4.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/@types/micromatch/-/micromatch-4.0.1.tgz",
|
||||||
|
@ -3162,12 +3174,24 @@
|
||||||
"is-glob": "^4.0.1"
|
"is-glob": "^4.0.1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"glob-regex": {
|
||||||
|
"version": "0.3.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/glob-regex/-/glob-regex-0.3.2.tgz",
|
||||||
|
"integrity": "sha512-m5blUd3/OqDTWwzBBtWBPrGlAzatRywHameHeekAZyZrskYouOGdNB8T/q6JucucvJXtOuyHIn0/Yia7iDasDw==",
|
||||||
|
"dev": true
|
||||||
|
},
|
||||||
"globals": {
|
"globals": {
|
||||||
"version": "11.12.0",
|
"version": "11.12.0",
|
||||||
"resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz",
|
"resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz",
|
||||||
"integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==",
|
"integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
|
"globrex": {
|
||||||
|
"version": "0.1.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/globrex/-/globrex-0.1.2.tgz",
|
||||||
|
"integrity": "sha512-uHJgbwAMwNFf5mLst7IWLNg14x1CkeqglJb/K3doi4dw6q2IvAAmM/Y81kevy83wP+Sst+nutFTYOGg3d1lsxg==",
|
||||||
|
"dev": true
|
||||||
|
},
|
||||||
"graceful-fs": {
|
"graceful-fs": {
|
||||||
"version": "4.2.9",
|
"version": "4.2.9",
|
||||||
"resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.9.tgz",
|
"resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.9.tgz",
|
||||||
|
@ -6188,6 +6212,18 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"recrawl-sync": {
|
||||||
|
"version": "2.2.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/recrawl-sync/-/recrawl-sync-2.2.1.tgz",
|
||||||
|
"integrity": "sha512-A2yLDgeXNaduJJMlqyUdIN7fewopnNm/mVeeGytS1d2HLXKpS5EthQ0j8tWeX+as9UXiiwQRwfoslKC+/gjqxg==",
|
||||||
|
"dev": true,
|
||||||
|
"requires": {
|
||||||
|
"@cush/relative": "^1.0.0",
|
||||||
|
"glob-regex": "^0.3.0",
|
||||||
|
"slash": "^3.0.0",
|
||||||
|
"tslib": "^1.9.3"
|
||||||
|
}
|
||||||
|
},
|
||||||
"regex-not": {
|
"regex-not": {
|
||||||
"version": "1.0.2",
|
"version": "1.0.2",
|
||||||
"resolved": "https://registry.npmjs.org/regex-not/-/regex-not-1.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/regex-not/-/regex-not-1.0.2.tgz",
|
||||||
|
@ -7075,6 +7111,35 @@
|
||||||
"integrity": "sha512-vDWbsl26LIcPGmDpoVzjEP6+hvHZkBkLW7JpvwbCv/5IYPJlsbzCVXY3wsCeAxAUeTclNOUZxnLdGh3VBD/J6w==",
|
"integrity": "sha512-vDWbsl26LIcPGmDpoVzjEP6+hvHZkBkLW7JpvwbCv/5IYPJlsbzCVXY3wsCeAxAUeTclNOUZxnLdGh3VBD/J6w==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
|
"tsconfig-paths": {
|
||||||
|
"version": "3.14.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.14.0.tgz",
|
||||||
|
"integrity": "sha512-cg/1jAZoL57R39+wiw4u/SCC6Ic9Q5NqjBOb+9xISedOYurfog9ZNmKJSxAnb2m/5Bq4lE9lhUcau33Ml8DM0g==",
|
||||||
|
"dev": true,
|
||||||
|
"requires": {
|
||||||
|
"@types/json5": "^0.0.29",
|
||||||
|
"json5": "^1.0.1",
|
||||||
|
"minimist": "^1.2.0",
|
||||||
|
"strip-bom": "^3.0.0"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"json5": {
|
||||||
|
"version": "1.0.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz",
|
||||||
|
"integrity": "sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==",
|
||||||
|
"dev": true,
|
||||||
|
"requires": {
|
||||||
|
"minimist": "^1.2.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"strip-bom": {
|
||||||
|
"version": "3.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz",
|
||||||
|
"integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=",
|
||||||
|
"dev": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"tslib": {
|
"tslib": {
|
||||||
"version": "1.14.1",
|
"version": "1.14.1",
|
||||||
"resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz",
|
"resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz",
|
||||||
|
@ -7305,6 +7370,18 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"vite-tsconfig-paths": {
|
||||||
|
"version": "3.4.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/vite-tsconfig-paths/-/vite-tsconfig-paths-3.4.1.tgz",
|
||||||
|
"integrity": "sha512-SgK3/pnTuJ3i+gMSAWLR6VCPSw26bnxawrmXGvCDjJgk8MAQgmbCrFrAzfwbwZBXSqSuvWEuX04Wt73qJKx8fQ==",
|
||||||
|
"dev": true,
|
||||||
|
"requires": {
|
||||||
|
"debug": "^4.1.1",
|
||||||
|
"globrex": "^0.1.2",
|
||||||
|
"recrawl-sync": "^2.0.3",
|
||||||
|
"tsconfig-paths": "^3.9.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
"void-elements": {
|
"void-elements": {
|
||||||
"version": "3.1.0",
|
"version": "3.1.0",
|
||||||
"resolved": "https://registry.npmjs.org/void-elements/-/void-elements-3.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/void-elements/-/void-elements-3.1.0.tgz",
|
||||||
|
|
|
@ -47,6 +47,7 @@
|
||||||
"typescript": "^4.2.3",
|
"typescript": "^4.2.3",
|
||||||
"vite": "^2.0.5",
|
"vite": "^2.0.5",
|
||||||
"vite-plugin-md2vue": "^1.1.1",
|
"vite-plugin-md2vue": "^1.1.1",
|
||||||
|
"vite-tsconfig-paths": "^3.4.1",
|
||||||
"vue-docgen-api": "^4.44.18"
|
"vue-docgen-api": "^4.44.18"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
8
packages/docs/tsconfig.json
Normal file
8
packages/docs/tsconfig.json
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
{
|
||||||
|
"extends": "../../tsconfig.json",
|
||||||
|
"compilerOptions": {
|
||||||
|
"paths": {
|
||||||
|
// "~/*": ["./lib/*"]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,8 +1,10 @@
|
||||||
import { defineConfig } from 'vite';
|
import { defineConfig } from 'vite';
|
||||||
import vueJsx from '@vitejs/plugin-vue-jsx';
|
import vueJsx from '@vitejs/plugin-vue-jsx';
|
||||||
import vitePluginMd2Vue from 'vite-plugin-md2vue';
|
import vitePluginMd2Vue from 'vite-plugin-md2vue';
|
||||||
|
import viteTSConfigPaths from 'vite-tsconfig-paths';
|
||||||
|
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
|
root: './',
|
||||||
base: './',
|
base: './',
|
||||||
resolve: {
|
resolve: {
|
||||||
dedupe: [ 'vue' ],
|
dedupe: [ 'vue' ],
|
||||||
|
@ -10,6 +12,7 @@ export default defineConfig({
|
||||||
plugins: [
|
plugins: [
|
||||||
vueJsx({}),
|
vueJsx({}),
|
||||||
vitePluginMd2Vue(),
|
vitePluginMd2Vue(),
|
||||||
|
viteTSConfigPaths(),
|
||||||
],
|
],
|
||||||
esbuild: {
|
esbuild: {
|
||||||
jsxFactory: 'h',
|
jsxFactory: 'h',
|
||||||
|
|
Loading…
Reference in a new issue