@note3/utils 0.1.5 → 0.1.7
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/dist/applog-collection.d.ts +49 -0
- package/dist/applog-collection.d.ts.map +1 -0
- package/dist/applog-collection.min.js +2 -0
- package/dist/applog-collection.min.js.map +1 -0
- package/dist/chunk-4ARVEMAY.min.js +2 -0
- package/dist/chunk-4ARVEMAY.min.js.map +1 -0
- package/dist/chunk-5TTMWYXD.min.js +3 -0
- package/dist/chunk-5TTMWYXD.min.js.map +1 -0
- package/dist/chunk-IFY2JCCQ.min.js +2 -0
- package/dist/chunk-IFY2JCCQ.min.js.map +1 -0
- package/dist/chunk-KFV32MHC.min.js +2 -0
- package/dist/chunk-KFV32MHC.min.js.map +1 -0
- package/dist/chunk-KHOUPFOL.min.js +1 -0
- package/dist/chunk-KHOUPFOL.min.js.map +1 -0
- package/dist/chunk-KY36PVHK.min.js +2 -0
- package/dist/chunk-KY36PVHK.min.js.map +1 -0
- package/dist/chunk-LDNVHZO7.min.js +2 -0
- package/dist/chunk-LDNVHZO7.min.js.map +1 -0
- package/dist/chunk-MXMMU6NF.min.js +2 -0
- package/dist/chunk-MXMMU6NF.min.js.map +1 -0
- package/dist/chunk-O72M27NE.min.js +2 -0
- package/dist/chunk-O72M27NE.min.js.map +1 -0
- package/dist/chunk-POX3PUJK.min.js +2 -0
- package/dist/chunk-POX3PUJK.min.js.map +1 -0
- package/dist/chunk-XL6QVLYO.min.js +2 -0
- package/dist/chunk-XL6QVLYO.min.js.map +1 -0
- package/dist/chunk-YXZYW2WJ.min.js +78 -0
- package/dist/chunk-YXZYW2WJ.min.js.map +1 -0
- package/dist/chunk-ZJUZ7RVG.min.js +2 -0
- package/dist/chunk-ZJUZ7RVG.min.js.map +1 -0
- package/dist/corejs.d.ts +19 -0
- package/dist/corejs.d.ts.map +1 -0
- package/dist/corejs.min.js +2 -0
- package/dist/corejs.min.js.map +1 -0
- package/dist/helpers.d.ts +7 -0
- package/dist/helpers.d.ts.map +1 -0
- package/dist/helpers.min.js +2 -0
- package/dist/helpers.min.js.map +1 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.min.js +2 -0
- package/dist/index.min.js.map +1 -0
- package/dist/map.d.ts +5 -0
- package/dist/map.d.ts.map +1 -0
- package/dist/map.min.js +2 -0
- package/dist/map.min.js.map +1 -0
- package/dist/note3-regex-constants.d.ts +21 -0
- package/dist/note3-regex-constants.d.ts.map +1 -0
- package/dist/note3-regex-constants.min.js +2 -0
- package/dist/note3-regex-constants.min.js.map +1 -0
- package/dist/note3-utils-nodeps.d.ts +22 -0
- package/dist/note3-utils-nodeps.d.ts.map +1 -0
- package/dist/note3-utils-nodeps.min.js +2 -0
- package/dist/note3-utils-nodeps.min.js.map +1 -0
- package/dist/queries.d.ts +53 -0
- package/dist/queries.d.ts.map +1 -0
- package/dist/queries.min.js +2 -0
- package/dist/queries.min.js.map +1 -0
- package/dist/relation-ordering.d.ts +13 -0
- package/dist/relation-ordering.d.ts.map +1 -0
- package/dist/relation-ordering.min.js +2 -0
- package/dist/relation-ordering.min.js.map +1 -0
- package/dist/tree-builder.d.ts +117 -0
- package/dist/tree-builder.d.ts.map +1 -0
- package/dist/tree-builder.min.js +2 -0
- package/dist/tree-builder.min.js.map +1 -0
- package/dist/types.d.ts +20 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.min.js +2 -0
- package/dist/types.min.js.map +1 -0
- package/dist/url-parsing.d.ts +138 -0
- package/dist/url-parsing.d.ts.map +1 -0
- package/dist/url-parsing.min.js +2 -0
- package/dist/url-parsing.min.js.map +1 -0
- package/package.json +2 -2
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import type { ApplogForInsertOptionalAgent, EntityID } from '@wovin/core/applog';
|
|
2
|
+
import type { TiptapContent } from './note3-utils-nodeps';
|
|
3
|
+
/**
|
|
4
|
+
* Represents a single node in a tree structure.
|
|
5
|
+
* Content can be a string or a Tiptap JSON object.
|
|
6
|
+
* Children are optional and can be recursively nested.
|
|
7
|
+
*/
|
|
8
|
+
export interface TreeNode {
|
|
9
|
+
/** Content as string or Tiptap object (auto-serialized) */
|
|
10
|
+
content: string | TiptapContent;
|
|
11
|
+
/** Optional child nodes */
|
|
12
|
+
children?: TreeNode[];
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Result of creating a single node with its applogs
|
|
16
|
+
*/
|
|
17
|
+
export interface NodeCreationResult {
|
|
18
|
+
blockID: EntityID;
|
|
19
|
+
applogs: ApplogForInsertOptionalAgent[];
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Result of creating a tree with applogs
|
|
23
|
+
*/
|
|
24
|
+
export interface TreeCreationResult {
|
|
25
|
+
rootIDs: EntityID[];
|
|
26
|
+
applogs: ApplogForInsertOptionalAgent[];
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Creates block applogs for a single piece of content.
|
|
30
|
+
* Generates an entity ID using getHashID, including positional context
|
|
31
|
+
* (parent and after) to ensure uniqueness even for identical content.
|
|
32
|
+
*
|
|
33
|
+
* @param content - String or TiptapContent object
|
|
34
|
+
* @param parentID - Optional parent ID for positional context in hash
|
|
35
|
+
* @param after - Optional previous sibling ID for positional context in hash
|
|
36
|
+
* @param entityID - Optional pre-computed entity ID
|
|
37
|
+
* @returns Object with generated entityID and applogs array
|
|
38
|
+
*/
|
|
39
|
+
export declare function createBlockApplogs(content: string | TiptapContent, parentID?: EntityID, after?: EntityID | null, entityID?: EntityID): {
|
|
40
|
+
en: EntityID;
|
|
41
|
+
applogs: ApplogForInsertOptionalAgent[];
|
|
42
|
+
};
|
|
43
|
+
/**
|
|
44
|
+
* Creates relation applogs that connect a block as a child of a parent.
|
|
45
|
+
* Generates three applogs: one for the block reference, one for the parent reference,
|
|
46
|
+
* and one for the sibling ordering (after).
|
|
47
|
+
*
|
|
48
|
+
* @param blockID - The ID of the child block
|
|
49
|
+
* @param childOf - The ID of the parent block
|
|
50
|
+
* @param after - The ID of the previous sibling (or null if first child)
|
|
51
|
+
* @param relationID - Optional pre-computed relation entity ID
|
|
52
|
+
* @returns Object with relation entity ID and applogs array
|
|
53
|
+
*/
|
|
54
|
+
export declare function createRelationApplogs(blockID: EntityID, childOf: EntityID, after: EntityID | null, relationID?: EntityID): {
|
|
55
|
+
en: EntityID;
|
|
56
|
+
applogs: ApplogForInsertOptionalAgent[];
|
|
57
|
+
};
|
|
58
|
+
/**
|
|
59
|
+
* Recursively creates applogs for a single node and its children.
|
|
60
|
+
* Maintains proper sibling ordering using the 'after' field.
|
|
61
|
+
*
|
|
62
|
+
* @param node - The node to create
|
|
63
|
+
* @param parentID - Optional parent block ID. If provided, creates a relation to parent.
|
|
64
|
+
* @param after - Optional previous sibling ID for proper ordering
|
|
65
|
+
* @returns Object with block ID and flattened applogs array
|
|
66
|
+
*/
|
|
67
|
+
export declare function createSingleNodeApplogs(node: TreeNode, parentID?: EntityID, after?: EntityID | null): NodeCreationResult;
|
|
68
|
+
/**
|
|
69
|
+
* Creates applogs for multiple root nodes (nodes without a parent).
|
|
70
|
+
* All nodes are created as standalone roots.
|
|
71
|
+
*
|
|
72
|
+
* @param nodes - Array of root nodes
|
|
73
|
+
* @returns Object with array of root IDs and flattened applogs
|
|
74
|
+
*
|
|
75
|
+
* @example
|
|
76
|
+
* const nodes: TreeNode[] = [
|
|
77
|
+
* { content: 'Root 1', children: [{ content: 'Child 1' }] },
|
|
78
|
+
* { content: 'Root 2' }
|
|
79
|
+
* ]
|
|
80
|
+
* const { rootIDs, applogs } = createTreeApplogs(nodes)
|
|
81
|
+
*/
|
|
82
|
+
export declare function createTreeApplogs(nodes: TreeNode[]): TreeCreationResult;
|
|
83
|
+
/**
|
|
84
|
+
* Creates applogs for multiple nodes as children of a parent.
|
|
85
|
+
* All nodes are created as children of the specified parent.
|
|
86
|
+
*
|
|
87
|
+
* @param nodes - Array of nodes
|
|
88
|
+
* @param parentID - Parent block ID. Nodes will be created as children of this parent.
|
|
89
|
+
* @returns Object with array of created block IDs and flattened applogs
|
|
90
|
+
*
|
|
91
|
+
* @example
|
|
92
|
+
* const subtree: TreeNode[] = [
|
|
93
|
+
* { content: 'Child 1' },
|
|
94
|
+
* { content: 'Child 2' }
|
|
95
|
+
* ]
|
|
96
|
+
* const { rootIDs, applogs } = createTreeApplogs(subtree, 'existingParentID')
|
|
97
|
+
*/
|
|
98
|
+
export declare function createTreeApplogs(nodes: TreeNode[], parentID: EntityID): TreeCreationResult;
|
|
99
|
+
/**
|
|
100
|
+
* Creates applogs for a single root node with its descendants.
|
|
101
|
+
* Convenience function that returns just the root block ID instead of an array.
|
|
102
|
+
*
|
|
103
|
+
* @param root - The root node
|
|
104
|
+
* @returns Object with root block ID and applogs
|
|
105
|
+
*
|
|
106
|
+
* @example
|
|
107
|
+
* const node: TreeNode = {
|
|
108
|
+
* content: 'Parent',
|
|
109
|
+
* children: [
|
|
110
|
+
* { content: 'Child 1' },
|
|
111
|
+
* { content: 'Child 2' }
|
|
112
|
+
* ]
|
|
113
|
+
* }
|
|
114
|
+
* const { blockID, applogs } = createSingleTree(node)
|
|
115
|
+
*/
|
|
116
|
+
export declare function createSingleTree(root: TreeNode): NodeCreationResult;
|
|
117
|
+
//# sourceMappingURL=tree-builder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tree-builder.d.ts","sourceRoot":"","sources":["../src/tree-builder.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,4BAA4B,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAA;AAEhF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AAEzD;;;;GAIG;AACH,MAAM,WAAW,QAAQ;IACxB,2DAA2D;IAC3D,OAAO,EAAE,MAAM,GAAG,aAAa,CAAA;IAC/B,2BAA2B;IAC3B,QAAQ,CAAC,EAAE,QAAQ,EAAE,CAAA;CACrB;AAED;;GAEG;AACH,MA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nE"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a,b,c,d,e}from"./chunk-ZJUZ7RVG.min.js";import"./chunk-YXZYW2WJ.min.js";import"./chunk-MXMMU6NF.min.js";export{a as createBlockApplogs,b as createRelationApplogs,c as createSingleNodeApplogs,e as createSingleTree,d as createTreeApplogs};
|
|
2
|
+
//# sourceMappingURL=tree-builder.min.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { EntityID } from '@wovin/core/applog';
|
|
2
|
+
export interface RelationInfo {
|
|
3
|
+
/** The relation's entity ID */
|
|
4
|
+
id: EntityID;
|
|
5
|
+
/** The child block ID */
|
|
6
|
+
block: EntityID;
|
|
7
|
+
/** The parent block ID */
|
|
8
|
+
childOf: EntityID;
|
|
9
|
+
/** Sibling ordering - ID of the block this should come after */
|
|
10
|
+
after: EntityID | null;
|
|
11
|
+
/** Whether the relation is expanded in UI */
|
|
12
|
+
isExpanded?: boolean;
|
|
13
|
+
/** Whether this is a mirror relation */
|
|
14
|
+
isMirror?: boolean;
|
|
15
|
+
/** Whether this is a reply relation */
|
|
16
|
+
isReply?: boolean;
|
|
17
|
+
/** Whether the relation is deleted */
|
|
18
|
+
isDeleted?: boolean;
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAA;AAElD,MAAM,WAAW,YAAY;IAC5B,+BAA+B;IAC/B,EAAE,EAAE,QAAQ,CAAA;IACZ,yBAAyB;IACzB,KAAK,EAAE,QAAQ,CAAA;IACf,0BAA0B;IAC1B,OAAO,EAAE,QAAQ,CAAA;IACjB,gEAAgE;IAChE,KAAK,EAAE,QAAQ,GAAG,IAAI,CAAA;IACtB,6CAA6C;IAC7C,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,wCAAwC;IACxC,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,uCAAuC;IACvC,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,sCAAsC;IACtC,SAAS,CAAC,EAAE,OAAO,CAAA;CACnB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
interface HashFragments {
|
|
2
|
+
[key: string]: string | null;
|
|
3
|
+
}
|
|
4
|
+
/**
|
|
5
|
+
* Parse hash fragments from a URL hash string
|
|
6
|
+
*
|
|
7
|
+
* @param hash The hash string (with or without leading #)
|
|
8
|
+
* @returns An object with key-value pairs from the hash fragments
|
|
9
|
+
*/
|
|
10
|
+
export declare function parseHashFragments(hash: string): HashFragments;
|
|
11
|
+
/**
|
|
12
|
+
* Get a specific hash fragment value from a URL
|
|
13
|
+
*
|
|
14
|
+
* @param url The URL object
|
|
15
|
+
* @param key The fragment key to retrieve
|
|
16
|
+
* @returns The value of the hash fragment, or null if not found
|
|
17
|
+
*/
|
|
18
|
+
export declare function getHashFragment(url: URL, key: string): string | null;
|
|
19
|
+
/**
|
|
20
|
+
* Convert a hash fragment object to a string
|
|
21
|
+
*
|
|
22
|
+
* @param fragments The hash fragments object
|
|
23
|
+
* @returns Hash string ready to be set as url.hash
|
|
24
|
+
*/
|
|
25
|
+
export declare function hashFragmentsToString(fragments: HashFragments): string;
|
|
26
|
+
/**
|
|
27
|
+
* Set a hash fragment on a URL. Modifies the URL in place.
|
|
28
|
+
*
|
|
29
|
+
* @param url The URL to modify
|
|
30
|
+
* @param key The fragment key
|
|
31
|
+
* @param value The fragment value (null to include key without value)
|
|
32
|
+
*/
|
|
33
|
+
export declare function setHashFragment(url: URL, key: string, value: string | null): void;
|
|
34
|
+
/**
|
|
35
|
+
* Delete a hash fragment from a URL. Modifies the URL in place.
|
|
36
|
+
*
|
|
37
|
+
* @param url The URL to modify
|
|
38
|
+
* @param key The fragment key to remove
|
|
39
|
+
*/
|
|
40
|
+
export declare function deleteHashFragment(url: URL, key: string): void;
|
|
41
|
+
/**
|
|
42
|
+
* Check if a hash fragment exists in a URL
|
|
43
|
+
*
|
|
44
|
+
* @param url The URL to check
|
|
45
|
+
* @param key The fragment key
|
|
46
|
+
* @returns true if the hash fragment exists
|
|
47
|
+
*/
|
|
48
|
+
export declare function hasHashFragment(url: URL, key: string): boolean;
|
|
49
|
+
/** Canonical Note3 origins */
|
|
50
|
+
export declare const CANONICAL_NOTE3_ORIGINS: readonly ["https://note3.app", "https://dev.note3.app"];
|
|
51
|
+
/**
|
|
52
|
+
* Get all known Note3 origins, including current browser origin if applicable
|
|
53
|
+
*
|
|
54
|
+
* Includes current origin when NOT on a path-based IPFS/IPNS gateway
|
|
55
|
+
* (i.e., when pathname doesn't start with /ipfs or /ipns)
|
|
56
|
+
*
|
|
57
|
+
* @returns Array of origins that should be treated as Note3 URLs
|
|
58
|
+
*/
|
|
59
|
+
export declare function getKnownNote3Origins(): string[];
|
|
60
|
+
/**
|
|
61
|
+
* Safe wrapper for URL constructor. Returns null instead of throwing.
|
|
62
|
+
*
|
|
63
|
+
* @param value The URL string to parse
|
|
64
|
+
* @returns Parsed URL object, or null if parsing fails
|
|
65
|
+
*/
|
|
66
|
+
export declare function tryParseURL(value: string): URL | null;
|
|
67
|
+
interface Note3URLParts {
|
|
68
|
+
share?: string;
|
|
69
|
+
preview?: boolean;
|
|
70
|
+
focus?: string;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Parse a Note3 URL in either note3:// protocol or hash-based format
|
|
74
|
+
*
|
|
75
|
+
* Supports formats:
|
|
76
|
+
* - note3://share/{pubkey}
|
|
77
|
+
* - https://note3.app#/block/{id}?share={pubkey}
|
|
78
|
+
* - https://note3.app#/block/{id}?preview={pubkey}
|
|
79
|
+
*
|
|
80
|
+
* @param value The URL string to parse
|
|
81
|
+
* @returns Object with share, preview, and focus properties, or null if not a valid Note3 URL
|
|
82
|
+
*/
|
|
83
|
+
export declare function tryParseNote3URL(value: string): Note3URLParts | null;
|
|
84
|
+
/**
|
|
85
|
+
* Create a Note3 URL with optional share or block parameters
|
|
86
|
+
*
|
|
87
|
+
* @param pub The public share key
|
|
88
|
+
* @param block The block ID to focus on
|
|
89
|
+
* @param previewPub If true, use preview parameter instead of share
|
|
90
|
+
* @param relative If true, return a relative URL without origin/protocol
|
|
91
|
+
* @returns Formatted Note3 URL
|
|
92
|
+
*/
|
|
93
|
+
export declare function makeNote3Url({ pub, block, previewPub, relative, }: {
|
|
94
|
+
pub?: string;
|
|
95
|
+
block?: string;
|
|
96
|
+
previewPub?: boolean;
|
|
97
|
+
relative?: boolean;
|
|
98
|
+
}): string;
|
|
99
|
+
/**
|
|
100
|
+
* Extract search parameters from the hash portion of a URL
|
|
101
|
+
*
|
|
102
|
+
* Useful for Note3 URLs where parameters appear after ? in the hash
|
|
103
|
+
* e.g., https://note3.app#/block/abc123?share=xyz
|
|
104
|
+
*
|
|
105
|
+
* @param hashPartOfUrl The hash string (defaults to window.location.hash)
|
|
106
|
+
* @returns URLSearchParams or null if no query parameters in hash
|
|
107
|
+
* @deprecated Consider using standard URL parsing instead for new code
|
|
108
|
+
*/
|
|
109
|
+
export declare function searchParamsFromHash(hashPartOfUrl?: string): URLSearchParams | null;
|
|
110
|
+
/**
|
|
111
|
+
* Replace search parameters in a URL
|
|
112
|
+
*
|
|
113
|
+
* @param location Location-like object with pathname and query
|
|
114
|
+
* @param params Object with key-value pairs to set
|
|
115
|
+
* @returns New URL string with updated parameters
|
|
116
|
+
*/
|
|
117
|
+
export declare function replaceSearchParamsInUrl(location: {
|
|
118
|
+
pathname?: string;
|
|
119
|
+
query?: Record<string, string> | string;
|
|
120
|
+
}, params: Record<string, string | null | undefined>): string;
|
|
121
|
+
/**
|
|
122
|
+
* Merge partial location/URI parts with existing location
|
|
123
|
+
*
|
|
124
|
+
* @param location The current location object
|
|
125
|
+
* @param replace Partial location with fields to replace
|
|
126
|
+
* @returns Full URI string with pathname, search, and hash
|
|
127
|
+
*/
|
|
128
|
+
export declare function replaceUriParts(location: {
|
|
129
|
+
pathname?: string;
|
|
130
|
+
search?: string;
|
|
131
|
+
hash?: string;
|
|
132
|
+
}, replace: Partial<{
|
|
133
|
+
pathname?: string;
|
|
134
|
+
search?: string;
|
|
135
|
+
hash?: string;
|
|
136
|
+
}>): string;
|
|
137
|
+
export {};
|
|
138
|
+
//# sourceMappingURL=url-parsing.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"url-parsing.d.ts","sourceRoot":"","sources":["../src/url-parsing.ts"],"names":[],"mappings":"AAQA,UAAU,aAAa;IACrB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAA;CAC7B;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,aAAa,CAoB9D;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAOpE;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,SAAS,EAAE,aAAa,GAAG,MAAM,CAStE;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,CAKjF;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI,CAK9D;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAG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AAI,CAAC,EAAE,MAAM,CAAA;CAAE,EAC/D,OAAO,EAAE,OAAO,CAAC;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,GACtE,MAAM,CAMR"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a,b,c,d,e,f,g,h,i,j,k,l,m,n}from"./chunk-4ARVEMAY.min.js";import"./chunk-5TTMWYXD.min.js";import"./chunk-MXMMU6NF.min.js";export{g as CANONICAL_NOTE3_ORIGINS,e as deleteHashFragment,b as getHashFragment,h as getKnownNote3Origins,f as hasHashFragment,c as hashFragmentsToString,k as makeNote3Url,a as parseHashFragments,m as replaceSearchParamsInUrl,n as replaceUriParts,l as searchParamsFromHash,d as setHashFragment,j as tryParseNote3URL,i as tryParseURL};
|
|
2
|
+
//# sourceMappingURL=url-parsing.min.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@note3/utils",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.7",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"private": false,
|
|
6
6
|
"main": "./dist/index.min.js",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"comlink": "^4.4.2",
|
|
32
32
|
"core-js": "^3.45.1",
|
|
33
33
|
"vite-plugin-comlink": "^5.3.0",
|
|
34
|
-
"@wovin/core": "^0.1.
|
|
34
|
+
"@wovin/core": "^0.1.7"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
37
|
"concurrently": "^8.2.2",
|