@atlaskit/node-data-provider 2.0.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/.eslintrc.js +14 -0
- package/CHANGELOG.md +24 -0
- package/LICENSE.md +11 -0
- package/README.md +48 -0
- package/cache/package.json +15 -0
- package/content/package.json +15 -0
- package/dist/cjs/cache.js +145 -0
- package/dist/cjs/consumption/_global-ndp-caches.js +21 -0
- package/dist/cjs/consumption/_internal-context.js +77 -0
- package/dist/cjs/consumption/_lru-cache.js +44 -0
- package/dist/cjs/consumption/content.js +53 -0
- package/dist/cjs/get-providers/confluence-page.js +15 -0
- package/dist/cjs/index.js +234 -0
- package/dist/cjs/internal-types.js +5 -0
- package/dist/cjs/plugin-hooks.js +97 -0
- package/dist/cjs/providers/emoji.js +54 -0
- package/dist/es2019/cache.js +96 -0
- package/dist/es2019/consumption/_global-ndp-caches.js +13 -0
- package/dist/es2019/consumption/_internal-context.js +71 -0
- package/dist/es2019/consumption/_lru-cache.js +28 -0
- package/dist/es2019/consumption/content.js +46 -0
- package/dist/es2019/get-providers/confluence-page.js +10 -0
- package/dist/es2019/index.js +193 -0
- package/dist/es2019/internal-types.js +1 -0
- package/dist/es2019/plugin-hooks.js +66 -0
- package/dist/es2019/providers/emoji.js +26 -0
- package/dist/esm/cache.js +141 -0
- package/dist/esm/consumption/_global-ndp-caches.js +13 -0
- package/dist/esm/consumption/_internal-context.js +71 -0
- package/dist/esm/consumption/_lru-cache.js +37 -0
- package/dist/esm/consumption/content.js +46 -0
- package/dist/esm/get-providers/confluence-page.js +9 -0
- package/dist/esm/index.js +230 -0
- package/dist/esm/internal-types.js +1 -0
- package/dist/esm/plugin-hooks.js +90 -0
- package/dist/esm/providers/emoji.js +47 -0
- package/dist/types/cache.d.ts +61 -0
- package/dist/types/consumption/_global-ndp-caches.d.ts +8 -0
- package/dist/types/consumption/_internal-context.d.ts +32 -0
- package/dist/types/consumption/_lru-cache.d.ts +7 -0
- package/dist/types/consumption/content.d.ts +65 -0
- package/dist/types/get-providers/confluence-page.d.ts +6 -0
- package/dist/types/index.d.ts +136 -0
- package/dist/types/internal-types.d.ts +2 -0
- package/dist/types/plugin-hooks.d.ts +32 -0
- package/dist/types/providers/emoji.d.ts +10 -0
- package/dist/types-ts4.5/cache.d.ts +61 -0
- package/dist/types-ts4.5/consumption/_global-ndp-caches.d.ts +8 -0
- package/dist/types-ts4.5/consumption/_internal-context.d.ts +32 -0
- package/dist/types-ts4.5/consumption/_lru-cache.d.ts +7 -0
- package/dist/types-ts4.5/consumption/content.d.ts +65 -0
- package/dist/types-ts4.5/get-providers/confluence-page.d.ts +6 -0
- package/dist/types-ts4.5/index.d.ts +136 -0
- package/dist/types-ts4.5/internal-types.d.ts +2 -0
- package/dist/types-ts4.5/plugin-hooks.d.ts +32 -0
- package/dist/types-ts4.5/providers/emoji.d.ts +10 -0
- package/emoji-provider/package.json +15 -0
- package/get-confluence-page-providers/package.json +15 -0
- package/package.json +73 -0
- package/plugin-hooks/package.json +15 -0
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
+
import type { NodeDataProvider } from './index';
|
|
3
|
+
/**
|
|
4
|
+
*
|
|
5
|
+
*
|
|
6
|
+
* This hook is intended to simplify accessing data via the one tick providers.
|
|
7
|
+
*
|
|
8
|
+
* ```ts
|
|
9
|
+
* const value = useNodeDataProviderGet(emojiProvider, emojiNode);
|
|
10
|
+
*
|
|
11
|
+
* if (value.state === 'loading') {
|
|
12
|
+
* return <Loading />;
|
|
13
|
+
* }
|
|
14
|
+
* if (value.state === 'failed') {
|
|
15
|
+
* return <Fallback />;
|
|
16
|
+
* }
|
|
17
|
+
* return <Emoji properties=(value.result) />
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
export declare function useNodeDataProviderGet<_NodeDataProvider extends NodeDataProvider<any, any>>(options: {
|
|
21
|
+
provider: _NodeDataProvider;
|
|
22
|
+
node: PMNode;
|
|
23
|
+
}): {
|
|
24
|
+
state: 'loading';
|
|
25
|
+
result: undefined;
|
|
26
|
+
} | {
|
|
27
|
+
state: 'failed';
|
|
28
|
+
result: undefined;
|
|
29
|
+
} | {
|
|
30
|
+
state: 'resolved';
|
|
31
|
+
result: _NodeDataProvider['cache'][string];
|
|
32
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type EmojiAttributes } from '@atlaskit/adf-schema';
|
|
2
|
+
import type { EmojiDescriptionWithVariations, EmojiProvider } from '@atlaskit/emoji';
|
|
3
|
+
import { NodeDataProvider } from '../index';
|
|
4
|
+
export declare function createEmojiNodeDataProvider({ emojiProvider, existingCache, }: {
|
|
5
|
+
emojiProvider: Promise<EmojiProvider>;
|
|
6
|
+
existingCache?: Record<string, EmojiDescriptionWithVariations>;
|
|
7
|
+
}): EmojiNodeDataProvider;
|
|
8
|
+
export type EmojiNodeDataProvider = NodeDataProvider<{
|
|
9
|
+
attrs: EmojiAttributes;
|
|
10
|
+
}, EmojiDescriptionWithVariations>;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import type { DocNode } from '@atlaskit/adf-schema';
|
|
2
|
+
import { type AnyNodeDataProvider } from './internal-types';
|
|
3
|
+
import { type EmojiNodeDataProvider } from './providers/emoji';
|
|
4
|
+
export type NodeDataProvidersCache = {
|
|
5
|
+
[nodeName: string]: Record<string, any>;
|
|
6
|
+
};
|
|
7
|
+
export type NodeDataProviders = {
|
|
8
|
+
emoji: EmojiNodeDataProvider;
|
|
9
|
+
[nodeName: string]: AnyNodeDataProvider;
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* Builds {@link NodeDataProvider}s caches for a document.
|
|
13
|
+
*
|
|
14
|
+
* It will traverse the document and call the resolve method for each node.
|
|
15
|
+
* When all promises are resolved, NodeDataProviders will have their caches populated.
|
|
16
|
+
*
|
|
17
|
+
* The providers will then be ready for use with an Editor.
|
|
18
|
+
*
|
|
19
|
+
* To limit the time spent building the cache, a signal can be provided to abort the request.
|
|
20
|
+
*
|
|
21
|
+
* ## Usage
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* ```ts
|
|
25
|
+
* buildCaches({
|
|
26
|
+
* adf: doc,
|
|
27
|
+
* nodeDataProviders: { emoji: emojiNodeDataProvider, ... },
|
|
28
|
+
* signal: AbortSignal.timeout(5000),
|
|
29
|
+
* });
|
|
30
|
+
* ```
|
|
31
|
+
*
|
|
32
|
+
* ### Using caches
|
|
33
|
+
*
|
|
34
|
+
* To make use of a cache in another provider (ie. for a cache created on the server), you can retrieve the cache
|
|
35
|
+
* from the provider and pass it to the new provider.
|
|
36
|
+
*
|
|
37
|
+
* @example
|
|
38
|
+
* ```tsx
|
|
39
|
+
* // SSR env
|
|
40
|
+
* const ssrProvidersCaches = await buildCaches({adf, nodeDataProviders: { emoji }})
|
|
41
|
+
*
|
|
42
|
+
* // Client env (providersCaches is the cache from the server)
|
|
43
|
+
* <ContentNodeDataProviders ... existingProvidersCache={ssrProvidersCaches} />
|
|
44
|
+
* ```
|
|
45
|
+
*
|
|
46
|
+
* *Note:* On the client - buildCache is not expected to be used directly.
|
|
47
|
+
*
|
|
48
|
+
* @see {@link ContentNodeDataProviders} for expected client usage.
|
|
49
|
+
*/
|
|
50
|
+
export declare function buildCaches({ adf, nodeDataProviders, signal, existingProvidersCache, }: {
|
|
51
|
+
adf?: DocNode;
|
|
52
|
+
/**
|
|
53
|
+
* Providers to build caches for
|
|
54
|
+
*/
|
|
55
|
+
nodeDataProviders: NodeDataProviders;
|
|
56
|
+
/**
|
|
57
|
+
* Signal to abort cache building -- the caches will be built up to the point of abort.
|
|
58
|
+
*/
|
|
59
|
+
signal?: AbortSignal;
|
|
60
|
+
existingProvidersCache?: NodeDataProvidersCache;
|
|
61
|
+
}): Promise<NodeDataProvidersCache>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type NodeDataProviders } from '../cache';
|
|
2
|
+
import { type LRUCache } from './_lru-cache';
|
|
3
|
+
type GlobalNdpCachesContextValue = {
|
|
4
|
+
[contentType: string]: LRUCache<NodeDataProviders>;
|
|
5
|
+
};
|
|
6
|
+
export declare function useGlobalNdpCachesContext(): GlobalNdpCachesContextValue;
|
|
7
|
+
export declare function _resetGlobalNdpCachesContext(): void;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { type DocNode } from '@atlaskit/adf-schema';
|
|
2
|
+
import { type NodeDataProviders, type NodeDataProvidersCache } from '../cache';
|
|
3
|
+
/**
|
|
4
|
+
* Sets up nodeview data providers for a content node.
|
|
5
|
+
*
|
|
6
|
+
* This will return the cached node data providers if they exist, otherwise it will call the provided getNodeDataProviders function.
|
|
7
|
+
*
|
|
8
|
+
* Note: Calling this has side effects where caches for the nodeview data providers will continue to be built
|
|
9
|
+
* in the background after this resolves to a set of nodeview data providers that can be used.
|
|
10
|
+
*/
|
|
11
|
+
export declare function useContentNodeDataProvidersSetup(content: {
|
|
12
|
+
/**
|
|
13
|
+
* The type of content.
|
|
14
|
+
*/
|
|
15
|
+
contentType: 'page';
|
|
16
|
+
contentId: string;
|
|
17
|
+
},
|
|
18
|
+
/**
|
|
19
|
+
* Note: changes to this object will not be reflected in the cache.
|
|
20
|
+
*/
|
|
21
|
+
setupOptions: {
|
|
22
|
+
/**
|
|
23
|
+
* Note: this will only be used if no existing NodeDataProviders are found for the content.
|
|
24
|
+
*/
|
|
25
|
+
adfToUpdateWith?: DocNode;
|
|
26
|
+
existingProvidersCache?: NodeDataProvidersCache;
|
|
27
|
+
getNodeDataProviders: () => NodeDataProviders;
|
|
28
|
+
onCacheWarmed?: (_: {
|
|
29
|
+
warmedNodeDataProvidersCache: NodeDataProvidersCache;
|
|
30
|
+
nodeDataProviders: NodeDataProviders;
|
|
31
|
+
}) => void;
|
|
32
|
+
}): NodeDataProviders | undefined;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type DocNode } from '@atlaskit/adf-schema';
|
|
3
|
+
import { type NodeDataProviders, type NodeDataProvidersCache } from '../cache';
|
|
4
|
+
import { _resetGlobalNdpCachesContext } from './_global-ndp-caches';
|
|
5
|
+
/**
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```tsx
|
|
9
|
+
* <ContentNodeDataProviders
|
|
10
|
+
* contentType="page" contentId="9001"
|
|
11
|
+
* adf={doc}
|
|
12
|
+
* placeholder={<Spinner />}
|
|
13
|
+
* existingProvidersCache={ssrProvidersCache}
|
|
14
|
+
* getNodeDataProviders={getPageNodeDataProviders}
|
|
15
|
+
* onCacheWarmed={trackCacheWarmed}
|
|
16
|
+
* >
|
|
17
|
+
* <Editor />
|
|
18
|
+
* </ContentNodeDataProviders>
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
export declare function ContentNodeDataProviders(props: {
|
|
22
|
+
/**
|
|
23
|
+
* The type of content, this is used to group the resulting providers cache
|
|
24
|
+
*
|
|
25
|
+
* Note: Providers Caches are stored in an internal LRU cache, are grouped by content type.
|
|
26
|
+
*/
|
|
27
|
+
contentType: 'page';
|
|
28
|
+
/**
|
|
29
|
+
* The type of content, this is used to group the resulting providers cache
|
|
30
|
+
*
|
|
31
|
+
*/
|
|
32
|
+
contentId: string;
|
|
33
|
+
/**
|
|
34
|
+
* This is optional - when passed the caches in the data providers will be warmed
|
|
35
|
+
* based on this document.
|
|
36
|
+
*/
|
|
37
|
+
adf?: DocNode;
|
|
38
|
+
/**
|
|
39
|
+
* This is optional, and supports passing in an existing providers cache.
|
|
40
|
+
*
|
|
41
|
+
* An example of this is when you have a server-side rendered providers cache that you want to use on the client.
|
|
42
|
+
*/
|
|
43
|
+
existingProvidersCache?: NodeDataProvidersCache;
|
|
44
|
+
/**
|
|
45
|
+
* Returns a set of `NodeDataProviders` which are put in context for use when creating an editor or renderer.
|
|
46
|
+
* These will be pre-warmed if adf is passed in.
|
|
47
|
+
*/
|
|
48
|
+
getNodeDataProviders: () => NodeDataProviders;
|
|
49
|
+
/**
|
|
50
|
+
* Called when the cache is warmed.
|
|
51
|
+
*/
|
|
52
|
+
onCacheWarmed?: (_: {
|
|
53
|
+
warmedNodeDataProvidersCache: NodeDataProvidersCache;
|
|
54
|
+
nodeDataProviders: NodeDataProviders;
|
|
55
|
+
}) => void;
|
|
56
|
+
children: React.ReactNode;
|
|
57
|
+
}): JSX.Element;
|
|
58
|
+
export declare function useContentNodeDataProviders(): NodeDataProviders | undefined;
|
|
59
|
+
export {
|
|
60
|
+
/**
|
|
61
|
+
* Exported for testing purposes only.
|
|
62
|
+
*
|
|
63
|
+
* This API will change.
|
|
64
|
+
*/
|
|
65
|
+
_resetGlobalNdpCachesContext as __testOnly_resetGlobalNdpCachesContext, };
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import type { buildCaches } from './cache';
|
|
2
|
+
export type { buildCaches as __doNotUseThisType };
|
|
3
|
+
/**
|
|
4
|
+
* This is the base class for creating a node data provider for an editor plugin.
|
|
5
|
+
*
|
|
6
|
+
* ## Usage
|
|
7
|
+
*
|
|
8
|
+
* ### Create a provider
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```ts
|
|
12
|
+
* class EmojiNodeDataProvider extends NodeDataProvider<
|
|
13
|
+
* { attrs: EmojiAttributes },
|
|
14
|
+
* { resolvedData: string }
|
|
15
|
+
* > {
|
|
16
|
+
* constructor({ existingCache }?: { existingCache: Record<string, { resolvedData: string }> }) {
|
|
17
|
+
* super({ existingCache, nodeName: 'emoji' });
|
|
18
|
+
* }
|
|
19
|
+
* nodeToKey(node: { attrs: EmojiAttributes }): string {
|
|
20
|
+
* return `${node.attrs.shortName}-${node.attrs.text}-${node.attrs.id}`;
|
|
21
|
+
* }
|
|
22
|
+
* resolve(node: { attrs: EmojiAttributes }, _?: { signal: AbortSignal }) {
|
|
23
|
+
* return Promise.resolve({ resolvedData: 'resolved' });
|
|
24
|
+
* }
|
|
25
|
+
* }
|
|
26
|
+
* ```
|
|
27
|
+
*
|
|
28
|
+
* ### Use the provider
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* ```ts
|
|
32
|
+
* const emojiNodeDataProvider = new EmojiNodeDataProvider();
|
|
33
|
+
* ```
|
|
34
|
+
*
|
|
35
|
+
* ### Caching
|
|
36
|
+
*
|
|
37
|
+
* @see {@link buildCaches} for more information on building caches.
|
|
38
|
+
*
|
|
39
|
+
* #### Load an existing provider with a cache
|
|
40
|
+
*
|
|
41
|
+
* @example
|
|
42
|
+
* ```
|
|
43
|
+
* await buildCaches({
|
|
44
|
+
* adf: docFromSomewhere,
|
|
45
|
+
* nodeDataProviders: [emojiNodeDataProvider],
|
|
46
|
+
* signal: AbortSignal.timeout(5000),
|
|
47
|
+
* });
|
|
48
|
+
* emojiNodeDataProvider // { 'key': 'value' }
|
|
49
|
+
* ```
|
|
50
|
+
*
|
|
51
|
+
* ### Load an new provider with an existing cache
|
|
52
|
+
*
|
|
53
|
+
* @example
|
|
54
|
+
* ```
|
|
55
|
+
* const provider1 = new ExampleNodeDataProvider();
|
|
56
|
+
* await buildCaches({adf, nodeDataProviders: [provider1]})
|
|
57
|
+
* provider1.cache // { 'key': 'value' }
|
|
58
|
+
*
|
|
59
|
+
* const provider2 = new ExampleNodeDataProvider({existingCache: provider1.cache});
|
|
60
|
+
* ```
|
|
61
|
+
*/
|
|
62
|
+
export declare class NodeDataProvider<INode extends ReceivableNode, Result extends unknown> {
|
|
63
|
+
/**
|
|
64
|
+
* This is added to ease building types
|
|
65
|
+
*/
|
|
66
|
+
__node: INode;
|
|
67
|
+
private __cache;
|
|
68
|
+
/**
|
|
69
|
+
* This takes a node and returns a key that can be used to cache the result of the resolve function.
|
|
70
|
+
*/
|
|
71
|
+
nodeToKey: (node: INode) => string;
|
|
72
|
+
/**
|
|
73
|
+
* This returns the information required to render a node.
|
|
74
|
+
*
|
|
75
|
+
* If unresolvable, this method will throw an error.
|
|
76
|
+
*
|
|
77
|
+
* If signal is aborted, this method will return undefined.
|
|
78
|
+
*/
|
|
79
|
+
resolve: (node: INode, _?: {
|
|
80
|
+
signal?: AbortSignal;
|
|
81
|
+
}) => Promise<Result | undefined>;
|
|
82
|
+
/**
|
|
83
|
+
* The adf node name this provider is responsible for.
|
|
84
|
+
*/
|
|
85
|
+
nodeName: string;
|
|
86
|
+
constructor({ existingCache, nodeName, nodeToKey, resolve, }: {
|
|
87
|
+
/**
|
|
88
|
+
* A cache to load the provider with.
|
|
89
|
+
*
|
|
90
|
+
* @see {@link buildCaches} for more information on building caches.
|
|
91
|
+
*/
|
|
92
|
+
existingCache?: Record<string, Result>;
|
|
93
|
+
/**
|
|
94
|
+
* The adf node name this provider is responsible for.
|
|
95
|
+
*
|
|
96
|
+
* It is used for;
|
|
97
|
+
* - determining if the traverser should use this provider to resolve a node when building caches
|
|
98
|
+
* - identifying the node when submitting analytics events via the helper react hooks
|
|
99
|
+
*/
|
|
100
|
+
nodeName: string;
|
|
101
|
+
nodeToKey: typeof NodeDataProvider.prototype.nodeToKey;
|
|
102
|
+
resolve: typeof NodeDataProvider.prototype.resolve;
|
|
103
|
+
});
|
|
104
|
+
/**
|
|
105
|
+
* Updates the providers cache.
|
|
106
|
+
*
|
|
107
|
+
* Useful in scenarios such as SSR where the cache is built on the server and then passed to the client.
|
|
108
|
+
*
|
|
109
|
+
* Avoids the need to provide the cache to the constructor (to allow decoupling creation of node data providers from cache building),
|
|
110
|
+
* and allow for caching to be managed at a group level across multiple providers.
|
|
111
|
+
*
|
|
112
|
+
* This is not expected to be used by consumers, for internal consumption examples;
|
|
113
|
+
* @see {@link buildCaches}
|
|
114
|
+
*
|
|
115
|
+
*/
|
|
116
|
+
updateCache(cache: Record<string, Result>, options: {
|
|
117
|
+
strategy: 'merge-override' | 'replace';
|
|
118
|
+
}): void;
|
|
119
|
+
/**
|
|
120
|
+
* This is the cache for the provider.
|
|
121
|
+
*/
|
|
122
|
+
get cache(): Record<string, Result>;
|
|
123
|
+
private pending;
|
|
124
|
+
get(node: INode, _?: {
|
|
125
|
+
signal: AbortSignal;
|
|
126
|
+
}): Promise<Result | undefined> | Result;
|
|
127
|
+
}
|
|
128
|
+
export type ReceivableNode = {
|
|
129
|
+
[key: string]: any;
|
|
130
|
+
attrs: {
|
|
131
|
+
[key: string]: any;
|
|
132
|
+
};
|
|
133
|
+
};
|
|
134
|
+
export type ResolveOptions = {
|
|
135
|
+
signal: AbortSignal;
|
|
136
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
+
import type { NodeDataProvider } from './index';
|
|
3
|
+
/**
|
|
4
|
+
*
|
|
5
|
+
*
|
|
6
|
+
* This hook is intended to simplify accessing data via the one tick providers.
|
|
7
|
+
*
|
|
8
|
+
* ```ts
|
|
9
|
+
* const value = useNodeDataProviderGet(emojiProvider, emojiNode);
|
|
10
|
+
*
|
|
11
|
+
* if (value.state === 'loading') {
|
|
12
|
+
* return <Loading />;
|
|
13
|
+
* }
|
|
14
|
+
* if (value.state === 'failed') {
|
|
15
|
+
* return <Fallback />;
|
|
16
|
+
* }
|
|
17
|
+
* return <Emoji properties=(value.result) />
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
export declare function useNodeDataProviderGet<_NodeDataProvider extends NodeDataProvider<any, any>>(options: {
|
|
21
|
+
provider: _NodeDataProvider;
|
|
22
|
+
node: PMNode;
|
|
23
|
+
}): {
|
|
24
|
+
state: 'loading';
|
|
25
|
+
result: undefined;
|
|
26
|
+
} | {
|
|
27
|
+
state: 'failed';
|
|
28
|
+
result: undefined;
|
|
29
|
+
} | {
|
|
30
|
+
state: 'resolved';
|
|
31
|
+
result: _NodeDataProvider['cache'][string];
|
|
32
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type EmojiAttributes } from '@atlaskit/adf-schema';
|
|
2
|
+
import type { EmojiDescriptionWithVariations, EmojiProvider } from '@atlaskit/emoji';
|
|
3
|
+
import { NodeDataProvider } from '../index';
|
|
4
|
+
export declare function createEmojiNodeDataProvider({ emojiProvider, existingCache, }: {
|
|
5
|
+
emojiProvider: Promise<EmojiProvider>;
|
|
6
|
+
existingCache?: Record<string, EmojiDescriptionWithVariations>;
|
|
7
|
+
}): EmojiNodeDataProvider;
|
|
8
|
+
export type EmojiNodeDataProvider = NodeDataProvider<{
|
|
9
|
+
attrs: EmojiAttributes;
|
|
10
|
+
}, EmojiDescriptionWithVariations>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@atlaskit/node-data-provider/emoji-provider",
|
|
3
|
+
"main": "../dist/cjs/providers/emoji.js",
|
|
4
|
+
"module": "../dist/esm/providers/emoji.js",
|
|
5
|
+
"module:es2019": "../dist/es2019/providers/emoji.js",
|
|
6
|
+
"sideEffects": false,
|
|
7
|
+
"types": "../dist/types/providers/emoji.d.ts",
|
|
8
|
+
"typesVersions": {
|
|
9
|
+
">=4.5 <5.4": {
|
|
10
|
+
"*": [
|
|
11
|
+
"../dist/types-ts4.5/providers/emoji.d.ts"
|
|
12
|
+
]
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@atlaskit/node-data-provider/get-confluence-page-providers",
|
|
3
|
+
"main": "../dist/cjs/get-providers/confluence-page.js",
|
|
4
|
+
"module": "../dist/esm/get-providers/confluence-page.js",
|
|
5
|
+
"module:es2019": "../dist/es2019/get-providers/confluence-page.js",
|
|
6
|
+
"sideEffects": false,
|
|
7
|
+
"types": "../dist/types/get-providers/confluence-page.d.ts",
|
|
8
|
+
"typesVersions": {
|
|
9
|
+
">=4.5 <5.4": {
|
|
10
|
+
"*": [
|
|
11
|
+
"../dist/types-ts4.5/get-providers/confluence-page.d.ts"
|
|
12
|
+
]
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@atlaskit/node-data-provider",
|
|
3
|
+
"version": "2.0.0",
|
|
4
|
+
"description": "Node data provider for @atlaskit/editor-core plugins and @atlaskit/renderer",
|
|
5
|
+
"author": "Atlassian Pty Ltd",
|
|
6
|
+
"license": "Apache-2.0",
|
|
7
|
+
"publishConfig": {
|
|
8
|
+
"registry": "https://registry.npmjs.org/"
|
|
9
|
+
},
|
|
10
|
+
"atlassian": {
|
|
11
|
+
"team": "Editor: Core Experiences",
|
|
12
|
+
"singleton": true,
|
|
13
|
+
"releaseModel": "continuous",
|
|
14
|
+
"runReact18": true
|
|
15
|
+
},
|
|
16
|
+
"repository": "https://stash.atlassian.com/projects/ATLASSIAN/repos/atlassian-frontend-monorepo",
|
|
17
|
+
"main": "dist/cjs/index.js",
|
|
18
|
+
"module": "dist/esm/index.js",
|
|
19
|
+
"module:es2019": "dist/es2019/index.js",
|
|
20
|
+
"types": "dist/types/index.d.ts",
|
|
21
|
+
"sideEffects": false,
|
|
22
|
+
"atlaskit:src": "src/index.ts",
|
|
23
|
+
"af:exports": {
|
|
24
|
+
".": "./src/index.ts",
|
|
25
|
+
"./plugin-hooks": "./src/plugin-hooks.ts",
|
|
26
|
+
"./content": "./src/consumption/content.tsx",
|
|
27
|
+
"./cache": "./src/cache.ts",
|
|
28
|
+
"./emoji-provider": "./src/providers/emoji.ts",
|
|
29
|
+
"./get-confluence-page-providers": "./src/get-providers/confluence-page.ts"
|
|
30
|
+
},
|
|
31
|
+
"dependencies": {
|
|
32
|
+
"@atlaskit/adf-schema": "^40.8.1",
|
|
33
|
+
"@atlaskit/adf-utils": "^19.8.0",
|
|
34
|
+
"@atlaskit/emoji": "^67.7.0",
|
|
35
|
+
"@babel/runtime": "^7.0.0"
|
|
36
|
+
},
|
|
37
|
+
"peerDependencies": {
|
|
38
|
+
"react": "^16.8.0"
|
|
39
|
+
},
|
|
40
|
+
"devDependencies": {
|
|
41
|
+
"@atlaskit/editor-test-helpers": "*",
|
|
42
|
+
"@testing-library/react": "^12.1.5",
|
|
43
|
+
"@testing-library/react-hooks": "^8.0.1",
|
|
44
|
+
"typescript": "~5.4.2"
|
|
45
|
+
},
|
|
46
|
+
"techstack": {
|
|
47
|
+
"@atlassian/frontend": {
|
|
48
|
+
"import-structure": [
|
|
49
|
+
"atlassian-conventions"
|
|
50
|
+
],
|
|
51
|
+
"circular-dependencies": [
|
|
52
|
+
"file-and-folder-level"
|
|
53
|
+
]
|
|
54
|
+
},
|
|
55
|
+
"@repo/internal": {
|
|
56
|
+
"dom-events": "use-bind-event-listener",
|
|
57
|
+
"analytics": [
|
|
58
|
+
"analytics-next"
|
|
59
|
+
],
|
|
60
|
+
"deprecation": [
|
|
61
|
+
"no-deprecated-imports"
|
|
62
|
+
],
|
|
63
|
+
"imports": [
|
|
64
|
+
"import-no-extraneous-disable-for-examples-and-docs"
|
|
65
|
+
]
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
"stricter": {
|
|
69
|
+
"no-unused-dependencies": {
|
|
70
|
+
"checkDevDependencies": true
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@atlaskit/node-data-provider/plugin-hooks",
|
|
3
|
+
"main": "../dist/cjs/plugin-hooks.js",
|
|
4
|
+
"module": "../dist/esm/plugin-hooks.js",
|
|
5
|
+
"module:es2019": "../dist/es2019/plugin-hooks.js",
|
|
6
|
+
"sideEffects": false,
|
|
7
|
+
"types": "../dist/types/plugin-hooks.d.ts",
|
|
8
|
+
"typesVersions": {
|
|
9
|
+
">=4.5 <5.4": {
|
|
10
|
+
"*": [
|
|
11
|
+
"../dist/types-ts4.5/plugin-hooks.d.ts"
|
|
12
|
+
]
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
}
|