@atlaskit/adf-schema 49.1.0 → 50.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/dist/cjs/index.js +18 -0
- package/dist/cjs/next-schema/generated/nodeTypes.js +22 -0
- package/dist/cjs/next-schema/nodes/tableNodes.js +17 -0
- package/dist/cjs/schema/index.js +18 -0
- package/dist/cjs/schema/nodes/index.js +18 -0
- package/dist/cjs/schema/nodes/tableNodes.js +69 -6
- package/dist/cjs/steps/types.js +5 -0
- package/dist/cjs/validator-schema/generated/validatorSpec.js +17 -0
- package/dist/es2019/index.js +1 -1
- package/dist/es2019/next-schema/generated/nodeTypes.js +22 -0
- package/dist/es2019/next-schema/nodes/tableNodes.js +17 -0
- package/dist/es2019/schema/default-schema.js +1 -1
- package/dist/es2019/schema/index.js +1 -1
- package/dist/es2019/schema/nodes/index.js +1 -1
- package/dist/es2019/schema/nodes/tableNodes.js +59 -3
- package/dist/es2019/steps/types.js +1 -0
- package/dist/es2019/validator-schema/generated/validatorSpec.js +17 -0
- package/dist/esm/index.js +1 -1
- package/dist/esm/next-schema/generated/nodeTypes.js +22 -0
- package/dist/esm/next-schema/nodes/tableNodes.js +17 -0
- package/dist/esm/schema/default-schema.js +1 -1
- package/dist/esm/schema/index.js +1 -1
- package/dist/esm/schema/nodes/index.js +1 -1
- package/dist/esm/schema/nodes/tableNodes.js +68 -5
- package/dist/esm/steps/types.js +1 -0
- package/dist/esm/validator-schema/generated/validatorSpec.js +17 -0
- package/dist/json-schema/v1/full.json +15 -0
- package/dist/json-schema/v1/stage-0.json +15 -0
- package/dist/types/index.d.ts +1 -1
- package/dist/types/next-schema/generated/nodeTypes.d.ts +10 -0
- package/dist/types/schema/index.d.ts +1 -1
- package/dist/types/schema/nodes/index.d.ts +1 -1
- package/dist/types/schema/nodes/tableNodes.d.ts +6 -0
- package/dist/types/steps/override-document-step.d.ts +2 -3
- package/dist/types/steps/types.d.ts +96 -0
- package/dist/types/validator-schema/generated/validatorSpec.d.ts +17 -0
- package/json-schema/v1/full.json +15 -0
- package/json-schema/v1/stage-0.json +15 -0
- package/package.json +1 -1
@@ -0,0 +1,96 @@
|
|
1
|
+
/**
|
2
|
+
* These types are taken from adf-utils, but not imported to avoid circular dependencies.
|
3
|
+
* They can be seen here:
|
4
|
+
* https://bitbucket.org/atlassian/atlassian-frontend-monorepo/src/master/platform/packages/editor/adf-utils/src/types/index.ts
|
5
|
+
*/
|
6
|
+
/**
|
7
|
+
* Represents a mark in the Atlassian Document Format (ADF).
|
8
|
+
* Marks are used to apply formatting or metadata to content, such as bold, italic, links, etc.
|
9
|
+
*
|
10
|
+
* @example
|
11
|
+
* ```typescript
|
12
|
+
* const boldMark: ADFEntityMark = {
|
13
|
+
* type: 'strong'
|
14
|
+
* };
|
15
|
+
*
|
16
|
+
* const linkMark: ADFEntityMark = {
|
17
|
+
* type: 'link',
|
18
|
+
* attrs: {
|
19
|
+
* href: 'https://example.com',
|
20
|
+
* title: 'Example Link'
|
21
|
+
* }
|
22
|
+
* };
|
23
|
+
* ```
|
24
|
+
*/
|
25
|
+
export interface ADFEntityMark {
|
26
|
+
/** The type of mark (e.g., 'strong', 'em', 'link', 'code', etc.) */
|
27
|
+
type: string;
|
28
|
+
/**
|
29
|
+
* Optional attributes for the mark, containing mark-specific properties.
|
30
|
+
* For example, a link mark would have 'href' and optionally 'title' attributes.
|
31
|
+
*/
|
32
|
+
attrs?: {
|
33
|
+
[name: string]: any;
|
34
|
+
};
|
35
|
+
}
|
36
|
+
/**
|
37
|
+
* Represents a node or entity in the Atlassian Document Format (ADF).
|
38
|
+
* This is the core building block of ADF documents, representing elements like
|
39
|
+
* paragraphs, headings, images, tables, and other content types.
|
40
|
+
*
|
41
|
+
* @example
|
42
|
+
* ```typescript
|
43
|
+
* const paragraph: ADFEntity = {
|
44
|
+
* type: 'paragraph',
|
45
|
+
* content: [
|
46
|
+
* {
|
47
|
+
* type: 'text',
|
48
|
+
* text: 'Hello world!',
|
49
|
+
* marks: [{ type: 'strong' }]
|
50
|
+
* }
|
51
|
+
* ]
|
52
|
+
* };
|
53
|
+
*
|
54
|
+
* const heading: ADFEntity = {
|
55
|
+
* type: 'heading',
|
56
|
+
* attrs: { level: 1 },
|
57
|
+
* content: [
|
58
|
+
* {
|
59
|
+
* type: 'text',
|
60
|
+
* text: 'Document Title'
|
61
|
+
* }
|
62
|
+
* ]
|
63
|
+
* };
|
64
|
+
* ```
|
65
|
+
*/
|
66
|
+
export interface ADFEntity {
|
67
|
+
/** The type of ADF node (e.g., 'doc', 'paragraph', 'heading', 'text', 'image', etc.) */
|
68
|
+
type: string;
|
69
|
+
/**
|
70
|
+
* Optional attributes for the entity, containing node-specific properties.
|
71
|
+
* For example, a heading node would have a 'level' attribute, an image would have 'src', etc.
|
72
|
+
*/
|
73
|
+
attrs?: {
|
74
|
+
[name: string]: any;
|
75
|
+
};
|
76
|
+
/**
|
77
|
+
* Optional array of child entities. Used for container nodes like paragraphs, headings, etc.
|
78
|
+
* Can contain undefined values to handle cases where content might be filtered or removed.
|
79
|
+
*/
|
80
|
+
content?: Array<ADFEntity | undefined>;
|
81
|
+
/**
|
82
|
+
* Optional array of marks applied to this entity.
|
83
|
+
* Marks provide formatting and metadata like bold, italic, links, etc.
|
84
|
+
*/
|
85
|
+
marks?: Array<ADFEntityMark>;
|
86
|
+
/**
|
87
|
+
* Optional text content for text nodes.
|
88
|
+
* Only present on nodes of type 'text'.
|
89
|
+
*/
|
90
|
+
text?: string;
|
91
|
+
/**
|
92
|
+
* Index signature to allow additional properties that may be specific to certain node types
|
93
|
+
* or used for extensions and custom functionality.
|
94
|
+
*/
|
95
|
+
[key: string]: any;
|
96
|
+
}
|
@@ -1698,6 +1698,10 @@ export declare const tableCell: {
|
|
1698
1698
|
type: string;
|
1699
1699
|
optional: boolean;
|
1700
1700
|
};
|
1701
|
+
localId: {
|
1702
|
+
type: string;
|
1703
|
+
optional: boolean;
|
1704
|
+
};
|
1701
1705
|
};
|
1702
1706
|
optional: boolean;
|
1703
1707
|
};
|
@@ -1737,6 +1741,10 @@ export declare const tableHeader: {
|
|
1737
1741
|
type: string;
|
1738
1742
|
optional: boolean;
|
1739
1743
|
};
|
1744
|
+
localId: {
|
1745
|
+
type: string;
|
1746
|
+
optional: boolean;
|
1747
|
+
};
|
1740
1748
|
};
|
1741
1749
|
optional: boolean;
|
1742
1750
|
};
|
@@ -1754,6 +1762,15 @@ export declare const tableRow: {
|
|
1754
1762
|
type: string;
|
1755
1763
|
values: string[];
|
1756
1764
|
};
|
1765
|
+
attrs: {
|
1766
|
+
props: {
|
1767
|
+
localId: {
|
1768
|
+
type: string;
|
1769
|
+
optional: boolean;
|
1770
|
+
};
|
1771
|
+
};
|
1772
|
+
optional: boolean;
|
1773
|
+
};
|
1757
1774
|
content: {
|
1758
1775
|
type: string;
|
1759
1776
|
items: string[][];
|
package/json-schema/v1/full.json
CHANGED
@@ -2438,6 +2438,9 @@
|
|
2438
2438
|
},
|
2439
2439
|
"background": {
|
2440
2440
|
"type": "string"
|
2441
|
+
},
|
2442
|
+
"localId": {
|
2443
|
+
"type": "string"
|
2441
2444
|
}
|
2442
2445
|
},
|
2443
2446
|
"additionalProperties": false
|
@@ -2472,6 +2475,9 @@
|
|
2472
2475
|
},
|
2473
2476
|
"background": {
|
2474
2477
|
"type": "string"
|
2478
|
+
},
|
2479
|
+
"localId": {
|
2480
|
+
"type": "string"
|
2475
2481
|
}
|
2476
2482
|
},
|
2477
2483
|
"additionalProperties": false
|
@@ -2541,6 +2547,15 @@
|
|
2541
2547
|
"type": {
|
2542
2548
|
"enum": ["tableRow"]
|
2543
2549
|
},
|
2550
|
+
"attrs": {
|
2551
|
+
"type": "object",
|
2552
|
+
"properties": {
|
2553
|
+
"localId": {
|
2554
|
+
"type": "string"
|
2555
|
+
}
|
2556
|
+
},
|
2557
|
+
"additionalProperties": false
|
2558
|
+
},
|
2544
2559
|
"content": {
|
2545
2560
|
"type": "array",
|
2546
2561
|
"items": {
|
@@ -2733,6 +2733,9 @@
|
|
2733
2733
|
},
|
2734
2734
|
"background": {
|
2735
2735
|
"type": "string"
|
2736
|
+
},
|
2737
|
+
"localId": {
|
2738
|
+
"type": "string"
|
2736
2739
|
}
|
2737
2740
|
},
|
2738
2741
|
"additionalProperties": false
|
@@ -2767,6 +2770,9 @@
|
|
2767
2770
|
},
|
2768
2771
|
"background": {
|
2769
2772
|
"type": "string"
|
2773
|
+
},
|
2774
|
+
"localId": {
|
2775
|
+
"type": "string"
|
2770
2776
|
}
|
2771
2777
|
},
|
2772
2778
|
"additionalProperties": false
|
@@ -2836,6 +2842,15 @@
|
|
2836
2842
|
"type": {
|
2837
2843
|
"enum": ["tableRow"]
|
2838
2844
|
},
|
2845
|
+
"attrs": {
|
2846
|
+
"type": "object",
|
2847
|
+
"properties": {
|
2848
|
+
"localId": {
|
2849
|
+
"type": "string"
|
2850
|
+
}
|
2851
|
+
},
|
2852
|
+
"additionalProperties": false
|
2853
|
+
},
|
2839
2854
|
"content": {
|
2840
2855
|
"type": "array",
|
2841
2856
|
"items": {
|
package/package.json
CHANGED