@atlaskit/editor-plugin-card 1.14.1 → 1.14.3

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 (42) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/dist/cjs/nodeviews/blockCard.js +9 -0
  3. package/dist/cjs/pm-plugins/doc.js +32 -11
  4. package/dist/cjs/pm-plugins/main.js +28 -6
  5. package/dist/cjs/toolbar.js +1 -1
  6. package/dist/cjs/ui/LayoutButton/index.js +11 -9
  7. package/dist/cjs/ui/LayoutButton/types.js +3 -1
  8. package/dist/cjs/ui/LayoutButton/utils.js +25 -1
  9. package/dist/cjs/utils.js +39 -1
  10. package/dist/es2019/nodeviews/blockCard.js +9 -0
  11. package/dist/es2019/pm-plugins/doc.js +33 -12
  12. package/dist/es2019/pm-plugins/main.js +24 -3
  13. package/dist/es2019/toolbar.js +2 -2
  14. package/dist/es2019/ui/LayoutButton/index.js +9 -7
  15. package/dist/es2019/ui/LayoutButton/types.js +1 -1
  16. package/dist/es2019/ui/LayoutButton/utils.js +19 -0
  17. package/dist/es2019/utils.js +36 -0
  18. package/dist/esm/nodeviews/blockCard.js +9 -0
  19. package/dist/esm/pm-plugins/doc.js +33 -12
  20. package/dist/esm/pm-plugins/main.js +24 -3
  21. package/dist/esm/toolbar.js +2 -2
  22. package/dist/esm/ui/LayoutButton/index.js +9 -7
  23. package/dist/esm/ui/LayoutButton/types.js +1 -1
  24. package/dist/esm/ui/LayoutButton/utils.js +23 -0
  25. package/dist/esm/utils.js +37 -0
  26. package/dist/types/pm-plugins/main.d.ts +2 -0
  27. package/dist/types/pm-plugins/shouldReplaceLink.d.ts +1 -1
  28. package/dist/types/pm-plugins/util/resolve.d.ts +1 -1
  29. package/dist/types/pm-plugins/util/state.d.ts +1 -1
  30. package/dist/types/types.d.ts +6 -1
  31. package/dist/types/ui/LayoutButton/types.d.ts +6 -5
  32. package/dist/types/ui/LayoutButton/utils.d.ts +7 -1
  33. package/dist/types/utils.d.ts +16 -1
  34. package/dist/types-ts4.5/pm-plugins/main.d.ts +2 -0
  35. package/dist/types-ts4.5/pm-plugins/shouldReplaceLink.d.ts +1 -1
  36. package/dist/types-ts4.5/pm-plugins/util/resolve.d.ts +1 -1
  37. package/dist/types-ts4.5/pm-plugins/util/state.d.ts +1 -1
  38. package/dist/types-ts4.5/types.d.ts +6 -1
  39. package/dist/types-ts4.5/ui/LayoutButton/types.d.ts +10 -5
  40. package/dist/types-ts4.5/ui/LayoutButton/utils.d.ts +7 -1
  41. package/dist/types-ts4.5/utils.d.ts +16 -1
  42. package/package.json +7 -4
@@ -2,7 +2,7 @@ import type { CardAppearance } from '@atlaskit/editor-common/provider-factory';
2
2
  import type { Node, NodeType } from '@atlaskit/editor-prosemirror/model';
3
3
  import type { EditorState } from '@atlaskit/editor-prosemirror/state';
4
4
  import type { CardContext } from '@atlaskit/link-provider';
5
- import type { CardInfo } from './types';
5
+ import type { CardInfo, DatasourceNode } from './types';
6
6
  export declare const appearanceForNodeType: (spec: NodeType) => CardAppearance | undefined;
7
7
  export declare const selectedCardAppearance: (state: EditorState) => CardAppearance | undefined;
8
8
  export type TitleUrlPair = {
@@ -22,3 +22,18 @@ export declare const isEmbedSupportedAtPosition: (currentNodePosition: number, e
22
22
  export declare const isBlockSupportedAtPosition: (currentNodePosition: number, editorState: EditorState, currentAppearance?: CardAppearance) => boolean;
23
23
  export declare const getResolvedAttributesFromStore: (url: string, display: string | null, store?: CardContext['store']) => {};
24
24
  export declare const isDatasourceConfigEditable: (datasourceId: string) => boolean;
25
+ /**
26
+ * Typeguard that checks node attributes are datasource node attributes
27
+ * ** WARNING ** Typeguards are not a guarantee, if the asserted type changes
28
+ * this function will not be updated automatically
29
+ */
30
+ export declare const isDatasourceAdfAttributes: (attrs: Record<string, unknown> | undefined) => attrs is {
31
+ url?: string | undefined;
32
+ datasource: import("@atlaskit/linking-common").Datasource<Record<string, unknown>>;
33
+ } & Partial<import("@atlaskit/adf-schema").RichMediaAttributes>;
34
+ /**
35
+ * Typeguard that checks a node is a datasource node (blockCard and has datasource attributes)
36
+ * ** WARNING ** Typeguards are not a guarantee, if the asserted type changes
37
+ * this function will not be updated automatically
38
+ */
39
+ export declare const isDatasourceNode: (node?: Node) => node is DatasourceNode;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-card",
3
- "version": "1.14.1",
3
+ "version": "1.14.3",
4
4
  "description": "Card plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -35,7 +35,7 @@
35
35
  "@atlaskit/adf-schema": "^36.8.0",
36
36
  "@atlaskit/analytics-next": "^9.3.0",
37
37
  "@atlaskit/custom-steps": "^0.2.0",
38
- "@atlaskit/editor-common": "^80.4.0",
38
+ "@atlaskit/editor-common": "^80.5.0",
39
39
  "@atlaskit/editor-plugin-analytics": "^1.2.0",
40
40
  "@atlaskit/editor-plugin-decorations": "^1.1.0",
41
41
  "@atlaskit/editor-plugin-editor-viewmode": "^1.1.0",
@@ -52,10 +52,10 @@
52
52
  "@atlaskit/link-client-extension": "^1.8.0",
53
53
  "@atlaskit/link-datasource": "^2.3.0",
54
54
  "@atlaskit/linking-common": "^5.7.0",
55
- "@atlaskit/linking-types": "^8.8.0",
55
+ "@atlaskit/linking-types": "^8.9.0",
56
56
  "@atlaskit/platform-feature-flags": "^0.2.0",
57
57
  "@atlaskit/primitives": "^6.3.0",
58
- "@atlaskit/smart-card": "^26.69.0",
58
+ "@atlaskit/smart-card": "^26.71.0",
59
59
  "@atlaskit/theme": "^12.8.0",
60
60
  "@atlaskit/tokens": "^1.49.0",
61
61
  "@babel/runtime": "^7.0.0",
@@ -131,6 +131,9 @@
131
131
  },
132
132
  "platform.linking-platform.smart-card.on-click-callback": {
133
133
  "type": "boolean"
134
+ },
135
+ "platform.linking-platform.editor-datasource-typeguards": {
136
+ "type": "boolean"
134
137
  }
135
138
  },
136
139
  "stricter": {