@atlaskit/adf-schema 31.1.2 → 32.1.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/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @atlaskit/adf-schema
2
2
 
3
+ ## 32.1.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 47644bb: Promote blockCard datasources to full schema
8
+
9
+ ## 32.0.0
10
+
11
+ ### Major Changes
12
+
13
+ - 9fb5cec: Remove fs use
14
+
3
15
  ## 31.1.2
4
16
 
5
17
  ### Patch Changes
package/dist/cjs/index.js CHANGED
@@ -687,12 +687,6 @@ Object.defineProperty(exports, "listItem", {
687
687
  return _schema.listItem;
688
688
  }
689
689
  });
690
- Object.defineProperty(exports, "marks", {
691
- enumerable: true,
692
- get: function get() {
693
- return _buildNodesAndMarks.marks;
694
- }
695
- });
696
690
  Object.defineProperty(exports, "media", {
697
691
  enumerable: true,
698
692
  get: function get() {
@@ -771,12 +765,6 @@ Object.defineProperty(exports, "nestedExpand", {
771
765
  return _schema.nestedExpand;
772
766
  }
773
767
  });
774
- Object.defineProperty(exports, "nodes", {
775
- enumerable: true,
776
- get: function get() {
777
- return _buildNodesAndMarks.nodes;
778
- }
779
- });
780
768
  Object.defineProperty(exports, "normalizeHexColor", {
781
769
  enumerable: true,
782
770
  get: function get() {
@@ -1048,5 +1036,4 @@ Object.defineProperty(exports, "uuid", {
1048
1036
  }
1049
1037
  });
1050
1038
  var _schema = require("./schema");
1051
- var _utils = require("./utils");
1052
- var _buildNodesAndMarks = require("./buildNodesAndMarks");
1039
+ var _utils = require("./utils");
@@ -8,10 +8,6 @@ exports.blockCard = void 0;
8
8
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
9
9
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
10
10
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
11
- /**
12
- * @stage 0
13
- */
14
-
15
11
  /**
16
12
  * @name blockCard_node
17
13
  */
@@ -1,4 +1,3 @@
1
1
  export { PanelType, AnnotationTypes, alignment, alignmentPositionMap, annotation, blockCard, blockquote, bodiedExtension, breakout, bulletList, bulletListSelector, caption, code, codeBlock, codeBlockToJSON, colorPalette, /** @deprecated [ED-15849] The extended palette is now rolled into the main one. Use `colorPalette` instead. */
2
2
  colorPaletteExtended, confluenceInlineComment, confluenceJiraIssue, confluenceUnsupportedBlock, confluenceUnsupportedInline, copyPrivateMediaAttributes, createSchema, dataConsumer, dataConsumerToJSON, date, decisionItem, decisionList, decisionListSelector, doc, em, embedCard, emoji, expand, expandToJSON, extension, fragment, fragmentToJSON, hardBreak, heading, image, indentation, inlineCard, inlineExtension, inlineNodes, layoutColumn, layoutSection, link, linkToJSON, listItem, media, mediaGroup, mediaSingle, mediaSingleWithCaption, mediaSingleWithWidthType, mediaSingleFull, mediaSingleSpec, mediaInline, mediaSingleToJSON, mediaToJSON, mention, mentionToJSON, nestedExpand, orderedList, orderedListSelector, orderedListWithOrder, panel, paragraph, placeholder, rule, sanitizeNodes, getCellAttrs, getCellDomAttrs, status, strike, strong, subsup, table, tableWithCustomWidth, tableBackgroundBorderColor, tableBackgroundColorNames, tableBackgroundColorPalette, tableCell, tableCellContentDomSelector, tableCellContentWrapperSelector, tableCellSelector, tableHeader, tableHeaderSelector, tablePrefixSelector, tableRow, tableToJSON, taskItem, taskList, taskListSelector, text, textColor, toJSONTableCell, toJSONTableHeader, typeAheadQuery, underline, unknownBlock, unsupportedBlock, unsupportedInline, unsupportedNodeTypesForMediaCards, buildAnnotationMarkDataAttributes, AnnotationMarkStates, unsupportedMark, unsupportedNodeAttribute, border, borderColorPalette } from './schema';
3
- export { B100, B400, B50, B500, B75, G200, G300, G400, G50, G500, G75, N0, N20, N200, N30, N300, N40, N50, N500, N60, N80, N800, N90, P100, P300, P400, P50, P500, P75, R100, R300, R400, R50, R500, R75, T100, T300, T50, T500, T75, Y200, Y400, Y50, Y500, Y75, acNameToEmoji, acShortcutToEmoji, emojiIdToAcName, generateUuid, getEmojiAcName, getLinkMatch, hexToRgb, hexToRgba, isHex, isRgb, isSafeUrl, linkify, linkifyMatch, normalizeHexColor, normalizeUrl, rgbToHex, uuid } from './utils';
4
- export { nodes, marks } from './buildNodesAndMarks';
3
+ export { B100, B400, B50, B500, B75, G200, G300, G400, G50, G500, G75, N0, N20, N200, N30, N300, N40, N50, N500, N60, N80, N800, N90, P100, P300, P400, P50, P500, P75, R100, R300, R400, R50, R500, R75, T100, T300, T50, T500, T75, Y200, Y400, Y50, Y500, Y75, acNameToEmoji, acShortcutToEmoji, emojiIdToAcName, generateUuid, getEmojiAcName, getLinkMatch, hexToRgb, hexToRgba, isHex, isRgb, isSafeUrl, linkify, linkifyMatch, normalizeHexColor, normalizeUrl, rgbToHex, uuid } from './utils';
@@ -1,7 +1,3 @@
1
- /**
2
- * @stage 0
3
- */
4
-
5
1
  /**
6
2
  * @name blockCard_node
7
3
  */
package/dist/esm/index.js CHANGED
@@ -1,4 +1,3 @@
1
1
  export { PanelType, AnnotationTypes, alignment, alignmentPositionMap, annotation, blockCard, blockquote, bodiedExtension, breakout, bulletList, bulletListSelector, caption, code, codeBlock, codeBlockToJSON, colorPalette, /** @deprecated [ED-15849] The extended palette is now rolled into the main one. Use `colorPalette` instead. */
2
2
  colorPaletteExtended, confluenceInlineComment, confluenceJiraIssue, confluenceUnsupportedBlock, confluenceUnsupportedInline, copyPrivateMediaAttributes, createSchema, dataConsumer, dataConsumerToJSON, date, decisionItem, decisionList, decisionListSelector, doc, em, embedCard, emoji, expand, expandToJSON, extension, fragment, fragmentToJSON, hardBreak, heading, image, indentation, inlineCard, inlineExtension, inlineNodes, layoutColumn, layoutSection, link, linkToJSON, listItem, media, mediaGroup, mediaSingle, mediaSingleWithCaption, mediaSingleWithWidthType, mediaSingleFull, mediaSingleSpec, mediaInline, mediaSingleToJSON, mediaToJSON, mention, mentionToJSON, nestedExpand, orderedList, orderedListSelector, orderedListWithOrder, panel, paragraph, placeholder, rule, sanitizeNodes, getCellAttrs, getCellDomAttrs, status, strike, strong, subsup, table, tableWithCustomWidth, tableBackgroundBorderColor, tableBackgroundColorNames, tableBackgroundColorPalette, tableCell, tableCellContentDomSelector, tableCellContentWrapperSelector, tableCellSelector, tableHeader, tableHeaderSelector, tablePrefixSelector, tableRow, tableToJSON, taskItem, taskList, taskListSelector, text, textColor, toJSONTableCell, toJSONTableHeader, typeAheadQuery, underline, unknownBlock, unsupportedBlock, unsupportedInline, unsupportedNodeTypesForMediaCards, buildAnnotationMarkDataAttributes, AnnotationMarkStates, unsupportedMark, unsupportedNodeAttribute, border, borderColorPalette } from './schema';
3
- export { B100, B400, B50, B500, B75, G200, G300, G400, G50, G500, G75, N0, N20, N200, N30, N300, N40, N50, N500, N60, N80, N800, N90, P100, P300, P400, P50, P500, P75, R100, R300, R400, R50, R500, R75, T100, T300, T50, T500, T75, Y200, Y400, Y50, Y500, Y75, acNameToEmoji, acShortcutToEmoji, emojiIdToAcName, generateUuid, getEmojiAcName, getLinkMatch, hexToRgb, hexToRgba, isHex, isRgb, isSafeUrl, linkify, linkifyMatch, normalizeHexColor, normalizeUrl, rgbToHex, uuid } from './utils';
4
- export { nodes, marks } from './buildNodesAndMarks';
3
+ export { B100, B400, B50, B500, B75, G200, G300, G400, G50, G500, G75, N0, N20, N200, N30, N300, N40, N50, N500, N60, N80, N800, N90, P100, P300, P400, P50, P500, P75, R100, R300, R400, R50, R500, R75, T100, T300, T50, T500, T75, Y200, Y400, Y50, Y500, Y75, acNameToEmoji, acShortcutToEmoji, emojiIdToAcName, generateUuid, getEmojiAcName, getLinkMatch, hexToRgb, hexToRgba, isHex, isRgb, isSafeUrl, linkify, linkifyMatch, normalizeHexColor, normalizeUrl, rgbToHex, uuid } from './utils';
@@ -1,10 +1,6 @@
1
1
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
2
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
3
3
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
4
- /**
5
- * @stage 0
6
- */
7
-
8
4
  /**
9
5
  * @name blockCard_node
10
6
  */
@@ -725,6 +725,64 @@
725
725
  },
726
726
  "attrs": {
727
727
  "anyOf": [
728
+ {
729
+ "type": "object",
730
+ "properties": {
731
+ "url": {
732
+ "type": "string"
733
+ },
734
+ "datasource": {
735
+ "type": "object",
736
+ "properties": {
737
+ "id": {
738
+ "type": "string"
739
+ },
740
+ "parameters": {},
741
+ "views": {
742
+ "type": "array",
743
+ "items": {
744
+ "type": "object",
745
+ "properties": {
746
+ "type": {
747
+ "type": "string"
748
+ },
749
+ "properties": {}
750
+ },
751
+ "required": [
752
+ "type"
753
+ ],
754
+ "additionalProperties": false
755
+ },
756
+ "minItems": 1
757
+ }
758
+ },
759
+ "required": [
760
+ "id",
761
+ "parameters",
762
+ "views"
763
+ ],
764
+ "additionalProperties": false
765
+ },
766
+ "width": {
767
+ "type": "number"
768
+ },
769
+ "layout": {
770
+ "enum": [
771
+ "wide",
772
+ "full-width",
773
+ "center",
774
+ "wrap-right",
775
+ "wrap-left",
776
+ "align-end",
777
+ "align-start"
778
+ ]
779
+ }
780
+ },
781
+ "additionalProperties": false,
782
+ "required": [
783
+ "datasource"
784
+ ]
785
+ },
728
786
  {
729
787
  "type": "object",
730
788
  "properties": {
@@ -4,4 +4,3 @@ colorPaletteExtended, confluenceInlineComment, confluenceJiraIssue, confluenceUn
4
4
  export type { AlignmentAttributes, AlignmentMarkDefinition, AnnotationMarkAttributes, AnnotationMarkDefinition, BlockCardDefinition, BlockContent, BlockQuoteDefinition, BodiedExtensionDefinition, BreakoutMarkAttrs, BreakoutMarkDefinition, BulletListDefinition, CaptionDefinition, CardAttributes, CellAttributes, CodeBlockAttrs, CodeBlockBaseDefinition, CodeBlockDefinition, CodeBlockWithMarksDefinition, CodeDefinition, DatasourceAttributes, DatasourceAttributeProperties, DataConsumerAttributes, DataConsumerDefinition, DataType, DateDefinition, DecisionItemDefinition, DecisionListDefinition, DocNode, EmbedCardDefinition, EmbedCardAttributes, EmDefinition, EmojiAttributes, EmojiDefinition, ExpandDefinition, ExtensionDefinition, ExtensionLayout, ExternalMediaAttributes, FragmentAttributes, FragmentDefinition, HardBreakDefinition, HeadingBaseDefinition, HeadingDefinition, HeadingWithAlignmentDefinition, HeadingWithIndentationDefinition, HeadingWithMarksDefinition, IndentationMarkAttributes, IndentationMarkDefinition, Inline, InlineAtomic, InlineCardDefinition, InlineCode, InlineExtensionDefinition, InlineFormattedText, InlineLinkText, LayoutColumnDefinition, LayoutSectionDefinition, LayoutSectionFullDefinition, LayoutSectionWithSingleColumnDefinition, LinkAttributes, LinkDefinition, ListItemArray, ListItemDefinition, MarksObject, MediaADFAttrs, MediaAttributes, MediaInlineAttributes, MediaInlineDefinition, MediaBaseAttributes, MediaDefinition, MediaDisplayType, MediaGroupDefinition, MediaSingleDefinition, MediaType, MentionAttributes, MentionDefinition, MentionUserType, NestedExpandContent, NestedExpandDefinition, NoMark, NonNestableBlockContent, OrderedListDefinition, PanelAttributes, PanelDefinition, ParagraphBaseDefinition, ParagraphDefinition, ParagraphWithAlignmentDefinition, ParagraphWithIndentationDefinition, ParagraphWithMarksDefinition, PlaceholderDefinition, RuleDefinition, StatusDefinition, StrikeDefinition, StrongDefinition, SubSupAttributes, SubSupDefinition, TableAttributes, TableCellDefinition, TableDefinition, TableHeaderDefinition, TableLayout, TableRowDefinition, TaskItemDefinition, TaskListContent, TaskListDefinition, TextColorAttributes, TextColorDefinition, TextDefinition, UnderlineDefinition, UrlType, AnnotationId, RichMediaAttributes, ExtendedMediaAttributes, RichMediaLayout, AnnotationDataAttributes, CellDomAttrs, BorderMarkAttributes, BorderMarkDefinition, } from './schema';
5
5
  export { B100, B400, B50, B500, B75, G200, G300, G400, G50, G500, G75, N0, N20, N200, N30, N300, N40, N50, N500, N60, N80, N800, N90, P100, P300, P400, P50, P500, P75, R100, R300, R400, R50, R500, R75, T100, T300, T50, T500, T75, Y200, Y400, Y50, Y500, Y75, acNameToEmoji, acShortcutToEmoji, emojiIdToAcName, generateUuid, getEmojiAcName, getLinkMatch, hexToRgb, hexToRgba, isHex, isRgb, isSafeUrl, linkify, linkifyMatch, normalizeHexColor, normalizeUrl, rgbToHex, uuid, } from './utils';
6
6
  export type { Match, NameToEmoji } from './utils';
7
- export { nodes, marks } from './buildNodesAndMarks';
@@ -23,9 +23,6 @@ export interface DatasourceAttributeProperties {
23
23
  properties?: object;
24
24
  }[];
25
25
  }
26
- /**
27
- * @stage 0
28
- */
29
26
  export interface DatasourceAttributes extends OptionalRichMediaAttributes {
30
27
  /**
31
28
  * @validatorFn safeUrl
@@ -725,6 +725,64 @@
725
725
  },
726
726
  "attrs": {
727
727
  "anyOf": [
728
+ {
729
+ "type": "object",
730
+ "properties": {
731
+ "url": {
732
+ "type": "string"
733
+ },
734
+ "datasource": {
735
+ "type": "object",
736
+ "properties": {
737
+ "id": {
738
+ "type": "string"
739
+ },
740
+ "parameters": {},
741
+ "views": {
742
+ "type": "array",
743
+ "items": {
744
+ "type": "object",
745
+ "properties": {
746
+ "type": {
747
+ "type": "string"
748
+ },
749
+ "properties": {}
750
+ },
751
+ "required": [
752
+ "type"
753
+ ],
754
+ "additionalProperties": false
755
+ },
756
+ "minItems": 1
757
+ }
758
+ },
759
+ "required": [
760
+ "id",
761
+ "parameters",
762
+ "views"
763
+ ],
764
+ "additionalProperties": false
765
+ },
766
+ "width": {
767
+ "type": "number"
768
+ },
769
+ "layout": {
770
+ "enum": [
771
+ "wide",
772
+ "full-width",
773
+ "center",
774
+ "wrap-right",
775
+ "wrap-left",
776
+ "align-end",
777
+ "align-start"
778
+ ]
779
+ }
780
+ },
781
+ "additionalProperties": false,
782
+ "required": [
783
+ "datasource"
784
+ ]
785
+ },
728
786
  {
729
787
  "type": "object",
730
788
  "properties": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/adf-schema",
3
- "version": "31.1.2",
3
+ "version": "32.1.0",
4
4
  "description": "Shared package that contains the ADF-schema (json) and ProseMirror node/mark specs",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -40,7 +40,7 @@
40
40
  "memoize-one": "^6.0.0"
41
41
  },
42
42
  "devDependencies": {
43
- "@atlassian/adf-schema-json": "^1.1.0",
43
+ "@atlassian/adf-schema-json": "^1.2.0",
44
44
  "@babel/cli": "^7.22.9",
45
45
  "@babel/core": "^7.22.9",
46
46
  "@babel/plugin-proposal-class-properties": "^7.18.6",
@@ -1,20 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.nodes = exports.marks = void 0;
8
- var _fs = _interopRequireDefault(require("fs"));
9
- var _path = _interopRequireDefault(require("path"));
10
- var buildFilesList = function buildFilesList(dirPath) {
11
- return _fs.default.readdirSync(dirPath).filter(function (node) {
12
- return !node.startsWith('.') && !node.startsWith('index');
13
- }).map(function (node) {
14
- return _path.default.basename(node, _path.default.extname(node));
15
- });
16
- };
17
- var nodes = buildFilesList(_path.default.join(__dirname, './schema/nodes'));
18
- exports.nodes = nodes;
19
- var marks = buildFilesList(_path.default.join(__dirname, './schema/marks'));
20
- exports.marks = marks;
@@ -1,6 +0,0 @@
1
- import fs from 'fs';
2
- import path from 'path';
3
- const buildFilesList = dirPath => fs.readdirSync(dirPath).filter(node => !node.startsWith('.') && !node.startsWith('index')).map(node => path.basename(node, path.extname(node)));
4
- const nodes = buildFilesList(path.join(__dirname, './schema/nodes'));
5
- const marks = buildFilesList(path.join(__dirname, './schema/marks'));
6
- export { nodes, marks };
@@ -1,12 +0,0 @@
1
- import fs from 'fs';
2
- import path from 'path';
3
- var buildFilesList = function buildFilesList(dirPath) {
4
- return fs.readdirSync(dirPath).filter(function (node) {
5
- return !node.startsWith('.') && !node.startsWith('index');
6
- }).map(function (node) {
7
- return path.basename(node, path.extname(node));
8
- });
9
- };
10
- var nodes = buildFilesList(path.join(__dirname, './schema/nodes'));
11
- var marks = buildFilesList(path.join(__dirname, './schema/marks'));
12
- export { nodes, marks };
@@ -1,3 +0,0 @@
1
- declare const nodes: string[];
2
- declare const marks: string[];
3
- export { nodes, marks };