@atlaskit/editor-plugin-local-id 9.0.15 → 10.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/CHANGELOG.md +32 -0
- package/local-id-plugin/package.json +1 -8
- package/local-id-plugin-type/package.json +1 -8
- package/package.json +9 -17
- package/utils/generateShortUUID/package.json +1 -8
- package/dist/types-ts4.5/editor-actions/index.d.ts +0 -12
- package/dist/types-ts4.5/entry-points/generate-short-uuid.d.ts +0 -1
- package/dist/types-ts4.5/entry-points/local-id-plugin-type.d.ts +0 -1
- package/dist/types-ts4.5/entry-points/local-id-plugin.d.ts +0 -1
- package/dist/types-ts4.5/index.d.ts +0 -2
- package/dist/types-ts4.5/localIdPlugin.d.ts +0 -2
- package/dist/types-ts4.5/localIdPluginType.d.ts +0 -41
- package/dist/types-ts4.5/pm-plugins/generateShortUUID.d.ts +0 -12
- package/dist/types-ts4.5/pm-plugins/main.d.ts +0 -12
- package/dist/types-ts4.5/pm-plugins/watchmen.d.ts +0 -32
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,37 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-local-id
|
|
2
2
|
|
|
3
|
+
## 10.0.0
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- [`f2dc9097319f0`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/f2dc9097319f0) - ###
|
|
8
|
+
Dropped support for _legacy_ Typescript 4 types. **Typescript 5 is now the new minimum**.
|
|
9
|
+
|
|
10
|
+
Removes the `typesVersions` property and `dist/types-ts4.5` directory from the dist.
|
|
11
|
+
|
|
12
|
+
Types are now exclusively via the `"types": "dist/types/index.d.ts"` property.
|
|
13
|
+
|
|
14
|
+
```diff
|
|
15
|
+
- "typesVersions": {
|
|
16
|
+
- ">=4.5 <4.9": {
|
|
17
|
+
- "*": [
|
|
18
|
+
- "dist/types-ts4.5/*",
|
|
19
|
+
- "dist/types-ts4.5/index.d.ts"
|
|
20
|
+
- ]
|
|
21
|
+
- }
|
|
22
|
+
- },
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
### Patch Changes
|
|
26
|
+
|
|
27
|
+
- Updated dependencies
|
|
28
|
+
|
|
29
|
+
## 9.0.16
|
|
30
|
+
|
|
31
|
+
### Patch Changes
|
|
32
|
+
|
|
33
|
+
- Updated dependencies
|
|
34
|
+
|
|
3
35
|
## 9.0.15
|
|
4
36
|
|
|
5
37
|
### Patch Changes
|
|
@@ -4,12 +4,5 @@
|
|
|
4
4
|
"module": "../dist/esm/entry-points/local-id-plugin.js",
|
|
5
5
|
"module:es2019": "../dist/es2019/entry-points/local-id-plugin.js",
|
|
6
6
|
"sideEffects": false,
|
|
7
|
-
"types": "../dist/types/entry-points/local-id-plugin.d.ts"
|
|
8
|
-
"typesVersions": {
|
|
9
|
-
">=4.5 <5.9": {
|
|
10
|
-
"*": [
|
|
11
|
-
"../dist/types-ts4.5/entry-points/local-id-plugin.d.ts"
|
|
12
|
-
]
|
|
13
|
-
}
|
|
14
|
-
}
|
|
7
|
+
"types": "../dist/types/entry-points/local-id-plugin.d.ts"
|
|
15
8
|
}
|
|
@@ -4,12 +4,5 @@
|
|
|
4
4
|
"module": "../dist/esm/entry-points/local-id-plugin-type.js",
|
|
5
5
|
"module:es2019": "../dist/es2019/entry-points/local-id-plugin-type.js",
|
|
6
6
|
"sideEffects": false,
|
|
7
|
-
"types": "../dist/types/entry-points/local-id-plugin-type.d.ts"
|
|
8
|
-
"typesVersions": {
|
|
9
|
-
">=4.5 <5.9": {
|
|
10
|
-
"*": [
|
|
11
|
-
"../dist/types-ts4.5/entry-points/local-id-plugin-type.d.ts"
|
|
12
|
-
]
|
|
13
|
-
}
|
|
14
|
-
}
|
|
7
|
+
"types": "../dist/types/entry-points/local-id-plugin-type.d.ts"
|
|
15
8
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-local-id",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "10.0.0",
|
|
4
4
|
"description": "LocalId plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -17,29 +17,21 @@
|
|
|
17
17
|
"module": "dist/esm/index.js",
|
|
18
18
|
"module:es2019": "dist/es2019/index.js",
|
|
19
19
|
"types": "dist/types/index.d.ts",
|
|
20
|
-
"typesVersions": {
|
|
21
|
-
">=4.5 <4.9": {
|
|
22
|
-
"*": [
|
|
23
|
-
"dist/types-ts4.5/*",
|
|
24
|
-
"dist/types-ts4.5/index.d.ts"
|
|
25
|
-
]
|
|
26
|
-
}
|
|
27
|
-
},
|
|
28
20
|
"sideEffects": false,
|
|
29
21
|
"atlaskit:src": "src/index.ts",
|
|
30
22
|
"dependencies": {
|
|
31
|
-
"@atlaskit/adf-schema": "^
|
|
32
|
-
"@atlaskit/editor-plugin-collab-edit": "^
|
|
33
|
-
"@atlaskit/editor-plugin-composition": "^
|
|
34
|
-
"@atlaskit/editor-plugin-limited-mode": "^
|
|
35
|
-
"@atlaskit/editor-prosemirror": "^
|
|
36
|
-
"@atlaskit/platform-feature-flags": "^
|
|
37
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
23
|
+
"@atlaskit/adf-schema": "^55.0.0",
|
|
24
|
+
"@atlaskit/editor-plugin-collab-edit": "^13.0.0",
|
|
25
|
+
"@atlaskit/editor-plugin-composition": "^11.0.0",
|
|
26
|
+
"@atlaskit/editor-plugin-limited-mode": "^9.0.0",
|
|
27
|
+
"@atlaskit/editor-prosemirror": "^8.0.0",
|
|
28
|
+
"@atlaskit/platform-feature-flags": "^2.0.0",
|
|
29
|
+
"@atlaskit/tmp-editor-statsig": "^104.0.0",
|
|
38
30
|
"@babel/runtime": "^7.0.0",
|
|
39
31
|
"raf-schd": "^4.0.3"
|
|
40
32
|
},
|
|
41
33
|
"peerDependencies": {
|
|
42
|
-
"@atlaskit/editor-common": "^
|
|
34
|
+
"@atlaskit/editor-common": "^116.0.0",
|
|
43
35
|
"react": "^18.2.0"
|
|
44
36
|
},
|
|
45
37
|
"devDependencies": {
|
|
@@ -4,12 +4,5 @@
|
|
|
4
4
|
"module": "../../dist/esm/entry-points/generate-short-uuid.js",
|
|
5
5
|
"module:es2019": "../../dist/es2019/entry-points/generate-short-uuid.js",
|
|
6
6
|
"sideEffects": false,
|
|
7
|
-
"types": "../../dist/types/entry-points/generate-short-uuid.d.ts"
|
|
8
|
-
"typesVersions": {
|
|
9
|
-
">=4.5 <5.9": {
|
|
10
|
-
"*": [
|
|
11
|
-
"../../dist/types-ts4.5/entry-points/generate-short-uuid.d.ts"
|
|
12
|
-
]
|
|
13
|
-
}
|
|
14
|
-
}
|
|
7
|
+
"types": "../../dist/types/entry-points/generate-short-uuid.d.ts"
|
|
15
8
|
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
2
|
-
import type { Node } from '@atlaskit/editor-prosemirror/model';
|
|
3
|
-
import type { Transform } from '@atlaskit/editor-prosemirror/transform';
|
|
4
|
-
import type { NodeWithPos } from '@atlaskit/editor-prosemirror/utils';
|
|
5
|
-
import type { ActionProps, LocalIdPlugin } from '../localIdPluginType';
|
|
6
|
-
type EditorActionProps = ActionProps;
|
|
7
|
-
export declare function findNodeByLocalId(tr: Transform, localId: string): NodeWithPos | undefined;
|
|
8
|
-
export declare const replaceNode: (api: ExtractInjectionAPI<LocalIdPlugin> | undefined) => ({ localId, value }: EditorActionProps & {
|
|
9
|
-
value: Node;
|
|
10
|
-
}) => boolean;
|
|
11
|
-
export declare const getNode: (api: ExtractInjectionAPI<LocalIdPlugin> | undefined) => ({ localId }: EditorActionProps) => NodeWithPos | undefined;
|
|
12
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { generateShortUUID, generatedShortUUIDs } from '../pm-plugins/generateShortUUID';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export type { LocalIdPlugin } from '../localIdPluginType';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { localIdPlugin } from '../localIdPlugin';
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import type { NextEditorPlugin, OptionalPlugin } from '@atlaskit/editor-common/types';
|
|
2
|
-
import type { CollabEditPlugin } from '@atlaskit/editor-plugin-collab-edit';
|
|
3
|
-
import type { CompositionPlugin } from '@atlaskit/editor-plugin-composition';
|
|
4
|
-
import type { LimitedModePlugin } from '@atlaskit/editor-plugin-limited-mode';
|
|
5
|
-
import type { Node } from '@atlaskit/editor-prosemirror/model';
|
|
6
|
-
import type { NodeWithPos } from '@atlaskit/editor-prosemirror/utils';
|
|
7
|
-
export type ActionProps = {
|
|
8
|
-
localId: string;
|
|
9
|
-
};
|
|
10
|
-
export type LocalIdStatusCode = 'current' | 'localChangeByAttr' | 'localChangeBySetAttrs' | 'localChangeByBatchAttrs' | 'localChangeByReplace' | 'localChangeByDelete' | 'localChangeByReplaceAround' | 'localChangeByUnknown' | 'remoteChangeByAttr' | 'remoteChangeBySetAttrs' | 'remoteChangeByBatchAttrs' | 'remoteChangeByReplace' | 'remoteChangeByDelete' | 'remoteChangeByReplaceAround' | 'remoteChangeByUnknown' | 'AIChangeByAttr' | 'AIChangeBySetAttrs' | 'AIChangeByBatchAttrs' | 'AIChangeByReplace' | 'AIChangeByDelete' | 'AIChangeByReplaceAround' | 'AIChangeByUnknown' | 'docChangeByAttr' | 'docChangeBySetAttrs' | 'docChangeByBatchAttrs' | 'docChangeByReplace' | 'docChangeByDelete' | 'docChangeByReplaceAround' | 'docChangeByUnknown';
|
|
11
|
-
export interface LocalIdSharedState {
|
|
12
|
-
localIdStatus: Map<string, LocalIdStatusCode> | undefined;
|
|
13
|
-
localIdWatchmenEnabled: boolean | undefined;
|
|
14
|
-
}
|
|
15
|
-
export type LocalIdPlugin = NextEditorPlugin<'localId', {
|
|
16
|
-
actions: {
|
|
17
|
-
/**
|
|
18
|
-
* Get the node with its position in the document
|
|
19
|
-
*
|
|
20
|
-
* @param props.localId Local id of the node in question
|
|
21
|
-
* @returns { node: ProsemirrorNode, pos: number } Object containing prosemirror node and position in the document
|
|
22
|
-
*/
|
|
23
|
-
getNode: (props: ActionProps) => NodeWithPos | undefined;
|
|
24
|
-
/**
|
|
25
|
-
* Replace the node in the document by its local id
|
|
26
|
-
*
|
|
27
|
-
* @param props.localId Local id of the node in question
|
|
28
|
-
* @param props.value Prosemirror node to replace the node with
|
|
29
|
-
* @returns boolean if the replace was successful
|
|
30
|
-
*/
|
|
31
|
-
replaceNode: (props: ActionProps & {
|
|
32
|
-
value: Node;
|
|
33
|
-
}) => boolean;
|
|
34
|
-
};
|
|
35
|
-
dependencies: [
|
|
36
|
-
CompositionPlugin,
|
|
37
|
-
OptionalPlugin<CollabEditPlugin>,
|
|
38
|
-
OptionalPlugin<LimitedModePlugin>
|
|
39
|
-
];
|
|
40
|
-
sharedState: LocalIdSharedState | undefined;
|
|
41
|
-
}>;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Global Set to track currently generated and existing short UUIDs in the document.
|
|
3
|
-
* Used to prevent duplicate short IDs when using crypto.randomUUID().
|
|
4
|
-
*/
|
|
5
|
-
export declare const generatedShortUUIDs: Set<string>;
|
|
6
|
-
/**
|
|
7
|
-
* Generates a short UUID and checks for duplicates against both
|
|
8
|
-
* generated UUIDs and existing UUIDs in the document.
|
|
9
|
-
* Retries up to 10 times if a duplicate is found.
|
|
10
|
-
* Falls back to full UUID if max retries exceeded.
|
|
11
|
-
*/
|
|
12
|
-
export declare const generateShortUUID: () => string;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
2
|
-
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
3
|
-
import { PluginKey, type Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
4
|
-
import type { LocalIdPlugin } from '../localIdPluginType';
|
|
5
|
-
export declare const localIdPluginKey: PluginKey;
|
|
6
|
-
export declare const createPlugin: (api: ExtractInjectionAPI<LocalIdPlugin> | undefined) => SafePlugin;
|
|
7
|
-
/**
|
|
8
|
-
* Batch adds local IDs to nodes using a BatchAttrsStep
|
|
9
|
-
* @param nodesToUpdate Map of position -> localId for nodes that need updates
|
|
10
|
-
* @param tr
|
|
11
|
-
*/
|
|
12
|
-
export declare const batchAddLocalIdToNodes: (nodesToUpdate: Map<number, string>, tr: Transaction) => void;
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
2
|
-
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
3
|
-
import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
4
|
-
import type { LocalIdPlugin, LocalIdStatusCode } from '../localIdPluginType';
|
|
5
|
-
/**
|
|
6
|
-
* Plugin state tracking all localIds in the document
|
|
7
|
-
*/
|
|
8
|
-
export type LocalIdWatchmenState = {
|
|
9
|
-
/**
|
|
10
|
-
* This flag controls whether or not the watchmen plugin will process transactions. Caution! disabling and then re-enabling
|
|
11
|
-
* this plugin will cause the watchment to rescan the whole document to sync the localId state.
|
|
12
|
-
*/
|
|
13
|
-
enabled: boolean;
|
|
14
|
-
/**
|
|
15
|
-
* This is the initial count of localIds when the plugin was first initialized.
|
|
16
|
-
*/
|
|
17
|
-
initLocalIdSize: number;
|
|
18
|
-
/**
|
|
19
|
-
* Timestamp of last state update for debugging
|
|
20
|
-
*/
|
|
21
|
-
lastUpdated: number;
|
|
22
|
-
/**
|
|
23
|
-
* This is a list of all localIds which have ever existed in the document and whether or not they're currently
|
|
24
|
-
* on the page (ie "active") or not.
|
|
25
|
-
*/
|
|
26
|
-
localIdStatus: Map<string, LocalIdStatusCode>;
|
|
27
|
-
};
|
|
28
|
-
export declare const localIdWatchmenPluginKey: PluginKey<LocalIdWatchmenState>;
|
|
29
|
-
/**
|
|
30
|
-
* Creates the localId watchmen plugin
|
|
31
|
-
*/
|
|
32
|
-
export declare const createWatchmenPlugin: (api: ExtractInjectionAPI<LocalIdPlugin> | undefined) => SafePlugin<LocalIdWatchmenState>;
|