@atlaskit/adf-schema 19.0.0 → 19.2.2

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.
Files changed (58) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/dist/cjs/index.js +14 -2
  3. package/dist/cjs/schema/create-schema.js +3 -0
  4. package/dist/cjs/schema/default-schema.js +6 -2
  5. package/dist/cjs/schema/index.js +20 -2
  6. package/dist/cjs/schema/nodes/index.js +22 -2
  7. package/dist/cjs/schema/nodes/layout-section.js +35 -3
  8. package/dist/cjs/schema/nodes/media-inline.js +11 -0
  9. package/dist/cjs/schema/nodes/media.js +8 -3
  10. package/dist/cjs/schema/nodes/tableNodes.js +13 -9
  11. package/dist/cjs/steps/analytics.js +3 -3
  12. package/dist/cjs/steps/type-ahead.js +134 -0
  13. package/dist/cjs/steps.js +14 -0
  14. package/dist/cjs/version.json +1 -1
  15. package/dist/es2019/index.js +1 -1
  16. package/dist/es2019/schema/create-schema.js +4 -1
  17. package/dist/es2019/schema/default-schema.js +5 -2
  18. package/dist/es2019/schema/index.js +1 -1
  19. package/dist/es2019/schema/nodes/index.js +3 -2
  20. package/dist/es2019/schema/nodes/layout-section.js +34 -1
  21. package/dist/es2019/schema/nodes/media-inline.js +2 -0
  22. package/dist/es2019/schema/nodes/media.js +70 -64
  23. package/dist/es2019/schema/nodes/tableNodes.js +10 -9
  24. package/dist/es2019/steps/analytics.js +2 -2
  25. package/dist/es2019/steps/type-ahead.js +85 -0
  26. package/dist/es2019/steps.js +1 -0
  27. package/dist/es2019/version.json +1 -1
  28. package/dist/esm/index.js +1 -1
  29. package/dist/esm/schema/create-schema.js +4 -1
  30. package/dist/esm/schema/default-schema.js +5 -2
  31. package/dist/esm/schema/index.js +1 -1
  32. package/dist/esm/schema/nodes/index.js +3 -2
  33. package/dist/esm/schema/nodes/layout-section.js +32 -1
  34. package/dist/esm/schema/nodes/media-inline.js +2 -0
  35. package/dist/esm/schema/nodes/media.js +8 -3
  36. package/dist/esm/schema/nodes/tableNodes.js +10 -9
  37. package/dist/esm/steps/analytics.js +3 -3
  38. package/dist/esm/steps/type-ahead.js +117 -0
  39. package/dist/esm/steps.js +1 -0
  40. package/dist/esm/version.json +1 -1
  41. package/dist/json-schema/v1/full.json +131 -97
  42. package/dist/json-schema/v1/stage-0.json +225 -97
  43. package/dist/types/index.d.ts +2 -2
  44. package/dist/types/schema/default-schema.d.ts +1 -1
  45. package/dist/types/schema/index.d.ts +2 -2
  46. package/dist/types/schema/nodes/index.d.ts +5 -3
  47. package/dist/types/schema/nodes/layout-section.d.ts +28 -1
  48. package/dist/types/schema/nodes/media-inline.d.ts +16 -0
  49. package/dist/types/schema/nodes/media.d.ts +1 -1
  50. package/dist/types/schema/nodes/tableNodes.d.ts +11 -1
  51. package/dist/types/schema/nodes/types/inline-content.d.ts +2 -1
  52. package/dist/types/steps/type-ahead.d.ts +35 -0
  53. package/dist/types/steps.d.ts +1 -0
  54. package/json-schema/v1/full.json +131 -97
  55. package/json-schema/v1/stage-0.json +225 -97
  56. package/package.json +3 -3
  57. package/test-helpers/schema-builder.ts +3 -0
  58. package/test-helpers/schema.ts +1 -0
@@ -0,0 +1,117 @@
1
+ import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
2
+ import _createClass from "@babel/runtime/helpers/createClass";
3
+ import _inherits from "@babel/runtime/helpers/inherits";
4
+ import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
5
+ import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
6
+
7
+ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
8
+
9
+ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
10
+
11
+ import { Slice } from 'prosemirror-model';
12
+ import { ReplaceStep, Step, StepMap, StepResult } from 'prosemirror-transform';
13
+ export var insertTypeAheadStepType = 'atlaskit-insert-type-ahead';
14
+ export var InsertTypeAheadStages;
15
+
16
+ (function (InsertTypeAheadStages) {
17
+ InsertTypeAheadStages["DELETING_RAW_QUERY"] = "DELETING_RAW_QUERY";
18
+ InsertTypeAheadStages["INSERTING_ITEM"] = "INSERTING_ITEM";
19
+ })(InsertTypeAheadStages || (InsertTypeAheadStages = {}));
20
+
21
+ export var InsertTypeAheadStep = /*#__PURE__*/function (_Step) {
22
+ _inherits(InsertTypeAheadStep, _Step);
23
+
24
+ var _super = _createSuper(InsertTypeAheadStep);
25
+
26
+ function InsertTypeAheadStep(_ref) {
27
+ var _this;
28
+
29
+ var stage = _ref.stage,
30
+ query = _ref.query,
31
+ trigger = _ref.trigger,
32
+ selectedIndex = _ref.selectedIndex;
33
+ var isInvertStep = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
34
+
35
+ _classCallCheck(this, InsertTypeAheadStep);
36
+
37
+ _this = _super.call(this);
38
+ _this.isInvertStep = isInvertStep;
39
+ _this.stage = stage;
40
+ _this.query = query;
41
+ _this.trigger = trigger;
42
+ _this.selectedIndex = selectedIndex;
43
+ return _this;
44
+ }
45
+
46
+ _createClass(InsertTypeAheadStep, [{
47
+ key: "invert",
48
+ value: function invert() {
49
+ var config = {
50
+ stage: this.stage,
51
+ query: this.query,
52
+ trigger: this.trigger,
53
+ selectedIndex: this.selectedIndex
54
+ };
55
+ return new InsertTypeAheadStep(config, !this.isInvertStep);
56
+ }
57
+ }, {
58
+ key: "apply",
59
+ value: function apply(doc) {
60
+ return StepResult.ok(doc);
61
+ }
62
+ }, {
63
+ key: "merge",
64
+ value: function merge() {
65
+ return null;
66
+ }
67
+ }, {
68
+ key: "isInsertionStep",
69
+ value: function isInsertionStep() {
70
+ return !this.isInvertStep;
71
+ }
72
+ }, {
73
+ key: "isUndoingStep",
74
+ value: function isUndoingStep() {
75
+ return this.isInvertStep;
76
+ }
77
+ }, {
78
+ key: "map",
79
+ value: function map(mapping) {
80
+ var config = {
81
+ stage: this.stage,
82
+ query: this.query,
83
+ trigger: this.trigger,
84
+ selectedIndex: this.selectedIndex
85
+ }; // Return the same events, this step will never be removed
86
+
87
+ return new InsertTypeAheadStep(config, this.isInvertStep);
88
+ }
89
+ }, {
90
+ key: "getMap",
91
+ value: function getMap() {
92
+ return new StepMap([0, 0, 0]);
93
+ }
94
+ }, {
95
+ key: "toJSON",
96
+ value: function toJSON() {
97
+ // When serialized we should create a noop Replace step
98
+ return {
99
+ stepType: 'replace',
100
+ from: 0,
101
+ to: 0
102
+ };
103
+ }
104
+ }], [{
105
+ key: "fromJSON",
106
+ value: function fromJSON() {
107
+ // This is a "local custom step" once serialized
108
+ // we need to transform it in a no-operation action
109
+ return new ReplaceStep(0, 0, Slice.empty);
110
+ }
111
+ }]);
112
+
113
+ return InsertTypeAheadStep;
114
+ }(Step);
115
+ /** Register this step with Prosemirror */
116
+
117
+ Step.jsonID(insertTypeAheadStepType, InsertTypeAheadStep);
package/dist/esm/steps.js CHANGED
@@ -1,5 +1,6 @@
1
1
  export { SortOrder as TableSortOrder } from './steps/table/constants';
2
2
  export { TableSortStep } from './steps/table/sort-column';
3
+ export { InsertTypeAheadStages, InsertTypeAheadStep } from './steps/type-ahead';
3
4
  export { AddColumnStep } from './steps/table/add-column';
4
5
  export { SetAttrsStep } from './steps/set-attrs';
5
6
  export { AnalyticsStep } from './steps/analytics';
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/adf-schema",
3
- "version": "19.0.0",
3
+ "version": "19.2.2",
4
4
  "sideEffects": false
5
5
  }
@@ -787,6 +787,95 @@
787
787
  ],
788
788
  "additionalProperties": false
789
789
  },
790
+ "media_node": {
791
+ "type": "object",
792
+ "properties": {
793
+ "type": {
794
+ "enum": [
795
+ "media"
796
+ ]
797
+ },
798
+ "attrs": {
799
+ "anyOf": [
800
+ {
801
+ "type": "object",
802
+ "properties": {
803
+ "type": {
804
+ "enum": [
805
+ "link",
806
+ "file"
807
+ ]
808
+ },
809
+ "id": {
810
+ "type": "string",
811
+ "minLength": 1
812
+ },
813
+ "collection": {
814
+ "type": "string"
815
+ },
816
+ "height": {
817
+ "type": "number"
818
+ },
819
+ "width": {
820
+ "type": "number"
821
+ },
822
+ "occurrenceKey": {
823
+ "type": "string",
824
+ "minLength": 1
825
+ },
826
+ "alt": {
827
+ "type": "string"
828
+ }
829
+ },
830
+ "required": [
831
+ "type",
832
+ "id",
833
+ "collection"
834
+ ],
835
+ "additionalProperties": false
836
+ },
837
+ {
838
+ "type": "object",
839
+ "properties": {
840
+ "type": {
841
+ "enum": [
842
+ "external"
843
+ ]
844
+ },
845
+ "url": {
846
+ "type": "string"
847
+ },
848
+ "alt": {
849
+ "type": "string"
850
+ },
851
+ "width": {
852
+ "type": "number"
853
+ },
854
+ "height": {
855
+ "type": "number"
856
+ }
857
+ },
858
+ "required": [
859
+ "type",
860
+ "url"
861
+ ],
862
+ "additionalProperties": false
863
+ }
864
+ ]
865
+ },
866
+ "marks": {
867
+ "type": "array",
868
+ "items": {
869
+ "$ref": "#/definitions/link_mark"
870
+ }
871
+ }
872
+ },
873
+ "required": [
874
+ "type",
875
+ "attrs"
876
+ ],
877
+ "additionalProperties": false
878
+ },
790
879
  "formatted_text_inline_node": {
791
880
  "allOf": [
792
881
  {
@@ -997,95 +1086,6 @@
997
1086
  ],
998
1087
  "additionalProperties": false
999
1088
  },
1000
- "media_node": {
1001
- "type": "object",
1002
- "properties": {
1003
- "type": {
1004
- "enum": [
1005
- "media"
1006
- ]
1007
- },
1008
- "attrs": {
1009
- "anyOf": [
1010
- {
1011
- "type": "object",
1012
- "properties": {
1013
- "type": {
1014
- "enum": [
1015
- "link",
1016
- "file"
1017
- ]
1018
- },
1019
- "id": {
1020
- "type": "string",
1021
- "minLength": 1
1022
- },
1023
- "collection": {
1024
- "type": "string"
1025
- },
1026
- "height": {
1027
- "type": "number"
1028
- },
1029
- "width": {
1030
- "type": "number"
1031
- },
1032
- "occurrenceKey": {
1033
- "type": "string",
1034
- "minLength": 1
1035
- },
1036
- "alt": {
1037
- "type": "string"
1038
- }
1039
- },
1040
- "required": [
1041
- "type",
1042
- "id",
1043
- "collection"
1044
- ],
1045
- "additionalProperties": false
1046
- },
1047
- {
1048
- "type": "object",
1049
- "properties": {
1050
- "type": {
1051
- "enum": [
1052
- "external"
1053
- ]
1054
- },
1055
- "url": {
1056
- "type": "string"
1057
- },
1058
- "alt": {
1059
- "type": "string"
1060
- },
1061
- "width": {
1062
- "type": "number"
1063
- },
1064
- "height": {
1065
- "type": "number"
1066
- }
1067
- },
1068
- "required": [
1069
- "type",
1070
- "url"
1071
- ],
1072
- "additionalProperties": false
1073
- }
1074
- ]
1075
- },
1076
- "marks": {
1077
- "type": "array",
1078
- "items": {
1079
- "$ref": "#/definitions/link_mark"
1080
- }
1081
- }
1082
- },
1083
- "required": [
1084
- "type",
1085
- "attrs"
1086
- ],
1087
- "additionalProperties": false
1088
- },
1089
1089
  "mediaSingle_node": {
1090
1090
  "type": "object",
1091
1091
  "properties": {
@@ -2368,18 +2368,16 @@
2368
2368
  "layoutSection"
2369
2369
  ]
2370
2370
  },
2371
- "content": {
2371
+ "marks": {
2372
2372
  "type": "array",
2373
2373
  "items": {
2374
- "$ref": "#/definitions/layoutColumn_node"
2375
- },
2376
- "minItems": 2,
2377
- "maxItems": 3
2374
+ "$ref": "#/definitions/breakout_mark"
2375
+ }
2378
2376
  },
2379
- "marks": {
2377
+ "content": {
2380
2378
  "type": "array",
2381
2379
  "items": {
2382
- "$ref": "#/definitions/breakout_mark"
2380
+ "$ref": "#/definitions/layoutColumn_node"
2383
2381
  }
2384
2382
  }
2385
2383
  },
@@ -2389,6 +2387,42 @@
2389
2387
  ],
2390
2388
  "additionalProperties": false
2391
2389
  },
2390
+ "layoutSection_full_node": {
2391
+ "allOf": [
2392
+ {
2393
+ "$ref": "#/definitions/layoutSection_node"
2394
+ },
2395
+ {
2396
+ "type": "object",
2397
+ "properties": {
2398
+ "type": {
2399
+ "enum": [
2400
+ "layoutSection"
2401
+ ]
2402
+ },
2403
+ "marks": {
2404
+ "type": "array",
2405
+ "items": {
2406
+ "$ref": "#/definitions/breakout_mark"
2407
+ }
2408
+ },
2409
+ "content": {
2410
+ "type": "array",
2411
+ "items": {
2412
+ "$ref": "#/definitions/layoutColumn_node"
2413
+ },
2414
+ "minItems": 2,
2415
+ "maxItems": 3
2416
+ }
2417
+ },
2418
+ "required": [
2419
+ "type",
2420
+ "content"
2421
+ ],
2422
+ "additionalProperties": false
2423
+ }
2424
+ ]
2425
+ },
2392
2426
  "doc_node": {
2393
2427
  "type": "object",
2394
2428
  "properties": {
@@ -2485,7 +2519,7 @@
2485
2519
  "$ref": "#/definitions/bodiedExtension_with_marks_node"
2486
2520
  },
2487
2521
  {
2488
- "$ref": "#/definitions/layoutSection_node"
2522
+ "$ref": "#/definitions/layoutSection_full_node"
2489
2523
  }
2490
2524
  ]
2491
2525
  }