@seed-design/react 1.1.5 → 1.1.8-alpha-20251120103616
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/lib/components/ScrollFog/ScrollFog.cjs +19 -7
- package/lib/components/ScrollFog/ScrollFog.d.ts +7 -2
- package/lib/components/ScrollFog/ScrollFog.d.ts.map +1 -1
- package/lib/components/ScrollFog/ScrollFog.js +19 -7
- package/lib/components/Slider/Slider.cjs +1 -1
- package/lib/components/Slider/Slider.d.ts +1 -1
- package/lib/components/Slider/Slider.d.ts.map +1 -1
- package/lib/components/Slider/Slider.js +1 -1
- package/lib/components/TextField/useTextFieldWithGraphemes.cjs +2 -2
- package/lib/components/TextField/useTextFieldWithGraphemes.js +1 -1
- package/package.json +2 -3
- package/src/components/ScrollFog/ScrollFog.tsx +30 -7
- package/src/components/Slider/Slider.tsx +1 -1
- package/src/components/TextField/useTextFieldWithGraphemes.ts +1 -1
- package/lib/node_modules/unicode-segmenter/_grapheme_data.cjs +0 -23
- package/lib/node_modules/unicode-segmenter/_grapheme_data.js +0 -19
- package/lib/node_modules/unicode-segmenter/_incb_data.cjs +0 -29
- package/lib/node_modules/unicode-segmenter/_incb_data.js +0 -25
- package/lib/node_modules/unicode-segmenter/core.cjs +0 -83
- package/lib/node_modules/unicode-segmenter/core.js +0 -78
- package/lib/node_modules/unicode-segmenter/grapheme.cjs +0 -312
- package/lib/node_modules/unicode-segmenter/grapheme.js +0 -307
|
@@ -5,13 +5,20 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
5
5
|
|
|
6
6
|
const jsxRuntime = require('react/jsx-runtime');
|
|
7
7
|
const scrollFog = require('@seed-design/css/recipes/scroll-fog');
|
|
8
|
-
const reactScrollable = require('@seed-design/react-scrollable');
|
|
9
8
|
const clsx = require('clsx');
|
|
10
9
|
const React = require('react');
|
|
11
10
|
const component = require('@seed-design/css/vars/component');
|
|
12
11
|
|
|
13
12
|
const ScrollFog = React.forwardRef(
|
|
14
|
-
({
|
|
13
|
+
({
|
|
14
|
+
className,
|
|
15
|
+
hideScrollBar,
|
|
16
|
+
placement = ["top", "bottom"],
|
|
17
|
+
size = component.scrollFog.base.enabled.root.size,
|
|
18
|
+
sizes,
|
|
19
|
+
style,
|
|
20
|
+
...props
|
|
21
|
+
}, ref) => {
|
|
15
22
|
const [variantProps, restProps] = scrollFog.scrollFog.splitVariantProps({
|
|
16
23
|
hideScrollBar,
|
|
17
24
|
...props
|
|
@@ -29,19 +36,24 @@ const ScrollFog = React.forwardRef(
|
|
|
29
36
|
"--scroll-fog-size-top": finalSizes.top,
|
|
30
37
|
"--scroll-fog-size-bottom": finalSizes.bottom,
|
|
31
38
|
"--scroll-fog-size-left": finalSizes.left,
|
|
32
|
-
"--scroll-fog-size-right": finalSizes.right
|
|
39
|
+
"--scroll-fog-size-right": finalSizes.right,
|
|
40
|
+
// placement에 포함된 방향만 1, 나머지는 0
|
|
41
|
+
"--scrollable-top": placement.includes("top") ? "1" : "0",
|
|
42
|
+
"--scrollable-bottom": placement.includes("bottom") ? "1" : "0",
|
|
43
|
+
"--scrollable-left": placement.includes("left") ? "1" : "0",
|
|
44
|
+
"--scrollable-right": placement.includes("right") ? "1" : "0"
|
|
33
45
|
};
|
|
34
|
-
}, [sizePx, sizes]);
|
|
46
|
+
}, [sizePx, sizes, placement]);
|
|
35
47
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
36
|
-
|
|
48
|
+
"div",
|
|
37
49
|
{
|
|
38
50
|
ref,
|
|
39
51
|
className: clsx(scrollFogClassName, className),
|
|
40
|
-
...restProps,
|
|
41
52
|
style: {
|
|
42
53
|
...style,
|
|
43
54
|
...sizeStyle
|
|
44
|
-
}
|
|
55
|
+
},
|
|
56
|
+
...restProps
|
|
45
57
|
}
|
|
46
58
|
);
|
|
47
59
|
}
|
|
@@ -1,13 +1,18 @@
|
|
|
1
1
|
import { ScrollFogVariantProps } from '@seed-design/css/recipes/scroll-fog';
|
|
2
|
-
import { ScrollableProps } from '@seed-design/react-scrollable';
|
|
3
2
|
import { ForwardRefExoticComponent, RefAttributes } from 'react';
|
|
3
|
+
type ScrollPlacement = "top" | "bottom" | "left" | "right";
|
|
4
4
|
type SizesConfig = {
|
|
5
5
|
top?: number;
|
|
6
6
|
bottom?: number;
|
|
7
7
|
left?: number;
|
|
8
8
|
right?: number;
|
|
9
9
|
};
|
|
10
|
-
export interface ScrollFogProps extends ScrollFogVariantProps,
|
|
10
|
+
export interface ScrollFogProps extends ScrollFogVariantProps, React.HTMLAttributes<HTMLDivElement> {
|
|
11
|
+
/**
|
|
12
|
+
* Placement of fog effect
|
|
13
|
+
* @default ["top", "bottom"]
|
|
14
|
+
*/
|
|
15
|
+
placement?: ScrollPlacement[];
|
|
11
16
|
/**
|
|
12
17
|
* Size of the fog effect in pixels
|
|
13
18
|
* @default 20
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScrollFog.d.ts","sourceRoot":"","sources":["../../../src/components/ScrollFog/ScrollFog.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAa,KAAK,qBAAqB,EAAE,MAAM,qCAAqC,CAAC;
|
|
1
|
+
{"version":3,"file":"ScrollFog.d.ts","sourceRoot":"","sources":["../../../src/components/ScrollFog/ScrollFog.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAa,KAAK,qBAAqB,EAAE,MAAM,qCAAqC,CAAC;AAK5F,KAAK,eAAe,GAAG,KAAK,GAAG,QAAQ,GAAG,MAAM,GAAG,OAAO,CAAC;AAE3D,KAAK,WAAW,GAAG;IACjB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,WAAW,cACf,SAAQ,qBAAqB,EAC3B,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;IACtC;;;OAGG;IACH,SAAS,CAAC,EAAE,eAAe,EAAE,CAAC;IAE9B;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,KAAK,CAAC,EAAE,WAAW,CAAC;CACrB;AAED,eAAO,MAAM,SAAS,2GAqDrB,CAAC"}
|
|
@@ -1,13 +1,20 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx } from 'react/jsx-runtime';
|
|
3
3
|
import { scrollFog } from '@seed-design/css/recipes/scroll-fog';
|
|
4
|
-
import { Scrollable } from '@seed-design/react-scrollable';
|
|
5
4
|
import clsx from 'clsx';
|
|
6
5
|
import { forwardRef, useMemo } from 'react';
|
|
7
6
|
import { scrollFog as scrollFog$1 } from '@seed-design/css/vars/component';
|
|
8
7
|
|
|
9
8
|
const ScrollFog = forwardRef(
|
|
10
|
-
({
|
|
9
|
+
({
|
|
10
|
+
className,
|
|
11
|
+
hideScrollBar,
|
|
12
|
+
placement = ["top", "bottom"],
|
|
13
|
+
size = scrollFog$1.base.enabled.root.size,
|
|
14
|
+
sizes,
|
|
15
|
+
style,
|
|
16
|
+
...props
|
|
17
|
+
}, ref) => {
|
|
11
18
|
const [variantProps, restProps] = scrollFog.splitVariantProps({
|
|
12
19
|
hideScrollBar,
|
|
13
20
|
...props
|
|
@@ -25,19 +32,24 @@ const ScrollFog = forwardRef(
|
|
|
25
32
|
"--scroll-fog-size-top": finalSizes.top,
|
|
26
33
|
"--scroll-fog-size-bottom": finalSizes.bottom,
|
|
27
34
|
"--scroll-fog-size-left": finalSizes.left,
|
|
28
|
-
"--scroll-fog-size-right": finalSizes.right
|
|
35
|
+
"--scroll-fog-size-right": finalSizes.right,
|
|
36
|
+
// placement에 포함된 방향만 1, 나머지는 0
|
|
37
|
+
"--scrollable-top": placement.includes("top") ? "1" : "0",
|
|
38
|
+
"--scrollable-bottom": placement.includes("bottom") ? "1" : "0",
|
|
39
|
+
"--scrollable-left": placement.includes("left") ? "1" : "0",
|
|
40
|
+
"--scrollable-right": placement.includes("right") ? "1" : "0"
|
|
29
41
|
};
|
|
30
|
-
}, [sizePx, sizes]);
|
|
42
|
+
}, [sizePx, sizes, placement]);
|
|
31
43
|
return /* @__PURE__ */ jsx(
|
|
32
|
-
|
|
44
|
+
"div",
|
|
33
45
|
{
|
|
34
46
|
ref,
|
|
35
47
|
className: clsx(scrollFogClassName, className),
|
|
36
|
-
...restProps,
|
|
37
48
|
style: {
|
|
38
49
|
...style,
|
|
39
50
|
...sizeStyle
|
|
40
|
-
}
|
|
51
|
+
},
|
|
52
|
+
...restProps
|
|
41
53
|
}
|
|
42
54
|
);
|
|
43
55
|
}
|
|
@@ -69,7 +69,7 @@ const SliderValueIndicatorRoot = withContext(
|
|
|
69
69
|
reactSlider.Slider.ValueIndicatorRoot,
|
|
70
70
|
"valueIndicatorRoot"
|
|
71
71
|
);
|
|
72
|
-
const SliderValueIndicatorLabel = reactSlider.Slider.ValueIndicatorLabel;
|
|
72
|
+
const SliderValueIndicatorLabel = withStateProps(reactSlider.Slider.ValueIndicatorLabel);
|
|
73
73
|
const SliderValueIndicatorArrow = withContext(withStateProps(reactPrimitive.Primitive.div), "valueIndicatorArrow");
|
|
74
74
|
const SliderValueIndicatorArrowTip = React.forwardRef(({ tipRadius = 2, className, ...otherProps }, ref) => {
|
|
75
75
|
const [valueIndicatorArrowTip, setValueIndicatorArrowTip] = React.useState(null);
|
|
@@ -36,7 +36,7 @@ export interface SliderValueIndicatorRootProps extends Slider.ValueIndicatorRoot
|
|
|
36
36
|
export declare const SliderValueIndicatorRoot: ForwardRefExoticComponent<SliderValueIndicatorRootProps & RefAttributes<HTMLDivElement>>;
|
|
37
37
|
export interface SliderValueIndicatorLabelProps extends Slider.ValueIndicatorLabelProps {
|
|
38
38
|
}
|
|
39
|
-
export declare const SliderValueIndicatorLabel: ForwardRefExoticComponent<Slider.ValueIndicatorLabelProps & RefAttributes<HTMLSpanElement>>;
|
|
39
|
+
export declare const SliderValueIndicatorLabel: ForwardRefExoticComponent<Omit<Slider.ValueIndicatorLabelProps & RefAttributes<HTMLSpanElement>, "ref"> & RefAttributes<HTMLSpanElement>>;
|
|
40
40
|
export interface SliderValueIndicatorArrowProps extends PrimitiveProps, HTMLAttributes<HTMLDivElement> {
|
|
41
41
|
}
|
|
42
42
|
export declare const SliderValueIndicatorArrow: ForwardRefExoticComponent<SliderValueIndicatorArrowProps & RefAttributes<HTMLDivElement>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Slider.d.ts","sourceRoot":"","sources":["../../../src/components/Slider/Slider.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAU,KAAK,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AAClF,OAAO,EAAc,KAAK,sBAAsB,EAAE,MAAM,sCAAsC,CAAC;AAC/F,OAAO,EAEL,KAAK,wBAAwB,EAC9B,MAAM,wCAAwC,CAAC;AAChD,OAAO,EAAa,KAAK,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAE9E,OAAO,EAAE,MAAM,EAAoB,MAAM,2BAA2B,CAAC;AACrE,OAAO,EAAwB,KAAK,cAAc,EAAE,MAAM,OAAO,CAAC;AAkBlE,MAAM,WAAW,eAAgB,SAAQ,kBAAkB,EAAE,MAAM,CAAC,SAAS;CAAG;AAEhF,eAAO,MAAM,UAAU,4GAAqE,CAAC;AAE7F,MAAM,WAAW,kBAAmB,SAAQ,cAAc,EAAE,cAAc,CAAC,cAAc,CAAC;CAAG;AAE7F,eAAO,MAAM,aAAa,+GAGzB,CAAC;AAEF,MAAM,WAAW,gBAAiB,SAAQ,cAAc,EAAE,cAAc,CAAC,cAAc,CAAC;CAAG;AAE3F,eAAO,MAAM,WAAW,6GAGvB,CAAC;AAEF,MAAM,WAAW,gBAAiB,SAAQ,MAAM,CAAC,UAAU;CAAG;AAE9D,eAAO,MAAM,WAAW,6GAGvB,CAAC;AAEF,MAAM,WAAW,gBAAiB,SAAQ,MAAM,CAAC,UAAU;CAAG;AAE9D,eAAO,MAA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;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,eAAO,MAAM,4BAA4B,0IA4BvC,CAAC"}
|
|
@@ -65,7 +65,7 @@ const SliderValueIndicatorRoot = withContext(
|
|
|
65
65
|
Slider.ValueIndicatorRoot,
|
|
66
66
|
"valueIndicatorRoot"
|
|
67
67
|
);
|
|
68
|
-
const SliderValueIndicatorLabel = Slider.ValueIndicatorLabel;
|
|
68
|
+
const SliderValueIndicatorLabel = withStateProps(Slider.ValueIndicatorLabel);
|
|
69
69
|
const SliderValueIndicatorArrow = withContext(withStateProps(Primitive.div), "valueIndicatorArrow");
|
|
70
70
|
const SliderValueIndicatorArrowTip = forwardRef(({ tipRadius = 2, className, ...otherProps }, ref) => {
|
|
71
71
|
const [valueIndicatorArrowTip, setValueIndicatorArrowTip] = useState(null);
|
|
@@ -4,10 +4,10 @@
|
|
|
4
4
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
5
5
|
|
|
6
6
|
const React = require('react');
|
|
7
|
-
const
|
|
7
|
+
const unicodeSegmenter = require('unicode-segmenter');
|
|
8
8
|
const memoize = require('./memoize.cjs');
|
|
9
9
|
|
|
10
|
-
const getGraphemes = (string) => Array.from(
|
|
10
|
+
const getGraphemes = (string) => Array.from(unicodeSegmenter.splitGraphemes(string));
|
|
11
11
|
const memoizedGetGraphemes = memoize.memoize(getGraphemes);
|
|
12
12
|
function useTextFieldWithGraphemes({
|
|
13
13
|
maxGraphemeCount,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { useState, useMemo, useCallback } from 'react';
|
|
3
|
-
import { splitGraphemes } from '
|
|
3
|
+
import { splitGraphemes } from 'unicode-segmenter';
|
|
4
4
|
import { memoize } from './memoize.js';
|
|
5
5
|
|
|
6
6
|
const getGraphemes = (string) => Array.from(splitGraphemes(string));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@seed-design/react",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.8-alpha-20251120103616",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/daangn/seed-design.git",
|
|
@@ -53,9 +53,8 @@
|
|
|
53
53
|
"@seed-design/react-progress": "1.0.0",
|
|
54
54
|
"@seed-design/react-pull-to-refresh": "1.0.1",
|
|
55
55
|
"@seed-design/react-radio-group": "1.0.1",
|
|
56
|
-
"@seed-design/react-scrollable": "1.0.0",
|
|
57
56
|
"@seed-design/react-segmented-control": "1.0.1",
|
|
58
|
-
"@seed-design/react-slider": "1.0.
|
|
57
|
+
"@seed-design/react-slider": "1.0.1",
|
|
59
58
|
"@seed-design/react-snackbar": "1.0.0",
|
|
60
59
|
"@seed-design/react-switch": "1.0.1",
|
|
61
60
|
"@seed-design/react-tabs": "1.0.1",
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { scrollFog, type ScrollFogVariantProps } from "@seed-design/css/recipes/scroll-fog";
|
|
2
|
-
import { Scrollable, type ScrollableProps } from "@seed-design/react-scrollable";
|
|
3
2
|
import clsx from "clsx";
|
|
4
3
|
import { forwardRef, useMemo } from "react";
|
|
5
4
|
import { scrollFog as vars } from "@seed-design/css/vars/component";
|
|
6
5
|
|
|
6
|
+
type ScrollPlacement = "top" | "bottom" | "left" | "right";
|
|
7
|
+
|
|
7
8
|
type SizesConfig = {
|
|
8
9
|
top?: number;
|
|
9
10
|
bottom?: number;
|
|
@@ -11,12 +12,21 @@ type SizesConfig = {
|
|
|
11
12
|
right?: number;
|
|
12
13
|
};
|
|
13
14
|
|
|
14
|
-
export interface ScrollFogProps
|
|
15
|
+
export interface ScrollFogProps
|
|
16
|
+
extends ScrollFogVariantProps,
|
|
17
|
+
React.HTMLAttributes<HTMLDivElement> {
|
|
18
|
+
/**
|
|
19
|
+
* Placement of fog effect
|
|
20
|
+
* @default ["top", "bottom"]
|
|
21
|
+
*/
|
|
22
|
+
placement?: ScrollPlacement[];
|
|
23
|
+
|
|
15
24
|
/**
|
|
16
25
|
* Size of the fog effect in pixels
|
|
17
26
|
* @default 20
|
|
18
27
|
*/
|
|
19
28
|
size?: number;
|
|
29
|
+
|
|
20
30
|
/**
|
|
21
31
|
* Size of the fog effect for each direction in pixels
|
|
22
32
|
*/
|
|
@@ -25,7 +35,15 @@ export interface ScrollFogProps extends ScrollFogVariantProps, ScrollableProps {
|
|
|
25
35
|
|
|
26
36
|
export const ScrollFog = forwardRef<HTMLDivElement, ScrollFogProps>(
|
|
27
37
|
(
|
|
28
|
-
{
|
|
38
|
+
{
|
|
39
|
+
className,
|
|
40
|
+
hideScrollBar,
|
|
41
|
+
placement = ["top", "bottom"],
|
|
42
|
+
size = vars.base.enabled.root.size,
|
|
43
|
+
sizes,
|
|
44
|
+
style,
|
|
45
|
+
...props
|
|
46
|
+
},
|
|
29
47
|
ref,
|
|
30
48
|
) => {
|
|
31
49
|
const [variantProps, restProps] = scrollFog.splitVariantProps({
|
|
@@ -48,18 +66,23 @@ export const ScrollFog = forwardRef<HTMLDivElement, ScrollFogProps>(
|
|
|
48
66
|
"--scroll-fog-size-bottom": finalSizes.bottom,
|
|
49
67
|
"--scroll-fog-size-left": finalSizes.left,
|
|
50
68
|
"--scroll-fog-size-right": finalSizes.right,
|
|
51
|
-
|
|
52
|
-
|
|
69
|
+
// placement에 포함된 방향만 1, 나머지는 0
|
|
70
|
+
"--scrollable-top": placement.includes("top") ? "1" : "0",
|
|
71
|
+
"--scrollable-bottom": placement.includes("bottom") ? "1" : "0",
|
|
72
|
+
"--scrollable-left": placement.includes("left") ? "1" : "0",
|
|
73
|
+
"--scrollable-right": placement.includes("right") ? "1" : "0",
|
|
74
|
+
} as React.CSSProperties;
|
|
75
|
+
}, [sizePx, sizes, placement]);
|
|
53
76
|
|
|
54
77
|
return (
|
|
55
|
-
<
|
|
78
|
+
<div
|
|
56
79
|
ref={ref}
|
|
57
80
|
className={clsx(scrollFogClassName, className)}
|
|
58
|
-
{...restProps}
|
|
59
81
|
style={{
|
|
60
82
|
...style,
|
|
61
83
|
...sizeStyle,
|
|
62
84
|
}}
|
|
85
|
+
{...restProps}
|
|
63
86
|
/>
|
|
64
87
|
);
|
|
65
88
|
},
|
|
@@ -103,7 +103,7 @@ export const SliderValueIndicatorRoot = withContext<HTMLDivElement, SliderValueI
|
|
|
103
103
|
|
|
104
104
|
export interface SliderValueIndicatorLabelProps extends Slider.ValueIndicatorLabelProps {}
|
|
105
105
|
|
|
106
|
-
export const SliderValueIndicatorLabel = Slider.ValueIndicatorLabel;
|
|
106
|
+
export const SliderValueIndicatorLabel = withStateProps(Slider.ValueIndicatorLabel);
|
|
107
107
|
|
|
108
108
|
export interface SliderValueIndicatorArrowProps
|
|
109
109
|
extends PrimitiveProps,
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
'use strict';
|
|
3
|
-
|
|
4
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
5
|
-
|
|
6
|
-
const core = require('./core.cjs');
|
|
7
|
-
|
|
8
|
-
// The following code was generated by "scripts/unicode.js",
|
|
9
|
-
// DO NOT EDIT DIRECTLY.
|
|
10
|
-
//
|
|
11
|
-
// @ts-check
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* @type {GraphemeCategoryRange[]}
|
|
16
|
-
*/
|
|
17
|
-
const grapheme_ranges = core.decodeUnicodeData(
|
|
18
|
-
/** @type {UnicodeDataEncoding} */
|
|
19
|
-
(',9,a,,b,1,d,,e,h,3j,w,4p,,4t,,4u,,lc,33,w3,6,13l,18,14v,,14x,1,150,1,153,,16o,5,174,a,17g,,18r,k,19s,,1cm,6,1ct,,1cv,5,1d3,1,1d6,3,1e7,,1e9,,1f4,q,1ie,a,1kb,8,1kt,,1li,3,1ln,8,1lx,2,1m1,4,1nd,2,1ow,1,1p3,8,1qi,n,1r6,,1r7,v,1s3,,1tm,,1tn,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p,q,ymg,,ymh,q,yn8,,yn9,q,yo0,,yo1,q,yos,,yot,q,ypk,,ypl,q,yqc,,yqd,q,yr4,,yr5,q,yrw,,yrx,q,yso,,ysp,q,ytg,,yth,q,yu8,,yu9,q,yv0,,yv1,q,yvs,,yvt,q,ywk,,ywl,q,yxc,,yxd,q,yy4,,yy5,q,yyw,,yyx,q,yzo,,yzp,q,z0g,,z0h,q,z18,,z19,q,z20,,z21,q,z2s,,z2t,q,z3k,,z3l,q,z4c,,z4d,q,z54,,z55,q,z5w,,z5x,q,z6o,,z6p,q,z7g,,z7h,q,z88,,z89,q,z90,,z91,q,z9s,,z9t,q,zak,,zal,q,zbc,,zbd,q,zc4,,zc5,q,zcw,,zcx,q,zdo,,zdp,q,zeg,,zeh,q,zf8,,zf9,q,zg0,,zg1,q,zgs,,zgt,q,zhk,,zhl,q,zic,,zid,q,zj4,,zj5,q,zjw,,zjx,q,zko,,zkp,q,zlg,,zlh,q,zm8,,zm9,q,zn0,,zn1,q,zns,,znt,q,zok,,zol,q,zpc,,zpd,q,zq4,,zq5,q,zqw,,zqx,q,zro,,zrp,q,zsg,,zsh,q,zt8,,zt9,q,zu0,,zu1,q,zus,,zut,q,zvk,,zvl,q,zwc,,zwd,q,zx4,,zx5,q,zxw,,zxx,q,zyo,,zyp,q,zzg,,zzh,q,1008,,1009,q,1010,,1011,q,101s,,101t,q,102k,,102l,q,103c,,103d,q,1044,,1045,q,104w,,104x,q,105o,,105p,q,106g,,106h,q,1078,,1079,q,1080,,1081,q,108s,,108t,q,109k,,109l,q,10ac,,10ad,q,10b4,,10b5,q,10bw,,10bx,q,10co,,10cp,q,10dg,,10dh,q,10e8,,10e9,q,10f0,,10f1,q,10fs,,10ft,q,10gk,,10gl,q,10hc,,10hd,q,10i4,,10i5,q,10iw,,10ix,q,10jo,,10jp,q,10kg,,10kh,q,10l8,,10l9,q,10m0,,10m1,q,10ms,,10mt,q,10nk,,10nl,q,10oc,,10od,q,10p4,,10p5,q,10pw,,10px,q,10qo,,10qp,q,10rg,,10rh,q,10s8,,10s9,q,10t0,,10t1,q,10ts,,10tt,q,10uk,,10ul,q,10vc,,10vd,q,10w4,,10w5,q,10ww,,10wx,q,10xo,,10xp,q,10yg,,10yh,q,10z8,,10z9,q,1100,,1101,q,110s,,110t,q,111k,,111l,q,112c,,112d,q,1134,,1135,q,113w,,113x,q,114o,,114p,q,115g,,115h,q,1168,,1169,q,1170,,1171,q,117s,,117t,q,118k,,118l,q,119c,,119d,q,11a4,,11a5,q,11aw,,11ax,q,11bo,,11bp,q,11cg,,11ch,q,11d8,,11d9,q,11e0,,11e1,q,11es,,11et,q,11fk,,11fl,q,11gc,,11gd,q,11h4,,11h5,q,11hw,,11hx,q,11io,,11ip,q,11jg,,11jh,q,11k8,,11k9,q,11l0,,11l1,q,11ls,,11lt,q,11mk,,11ml,q,11nc,,11nd,q,11o4,,11o5,q,11ow,,11ox,q,11po,,11pp,q,11qg,,11qh,q,11r8,,11r9,q,11s0,,11s1,q,11ss,,11st,q,11tk,,11tl,q,11uc,,11ud,q,11v4,,11v5,q,11vw,,11vx,q,11wo,,11wp,q,11xg,,11xh,q,11y8,,11y9,q,11z0,,11z1,q,11zs,,11zt,q,120k,,120l,q,121c,,121d,q,1224,,1225,q,122w,,122x,q,123o,,123p,q,124g,,124h,q,1258,,1259,q,1260,,1261,q,126s,,126t,q,127k,,127l,q,128c,,128d,q,1294,,1295,q,129w,,129x,q,12ao,,12ap,q,12bg,,12bh,q,12c8,,12c9,q,12d0,,12d1,q,12ds,,12dt,q,12ek,,12el,q,12fc,,12fd,q,12g4,,12g5,q,12gw,,12gx,q,12ho,,12hp,q,12ig,,12ih,q,12j8,,12j9,q,12k0,,12k1,q,12ks,,12kt,q,12lk,,12ll,q,12mc,,12md,q,12n4,,12n5,q,12nw,,12nx,q,12oo,,12op,q,12pg,,12ph,q,12q8,,12q9,q,12r0,,12r1,q,12rs,,12rt,q,12sk,,12sl,q,12tc,,12td,q,12u4,,12u5,q,12uw,,12ux,q,12vo,,12vp,q,12wg,,12wh,q,12x8,,12x9,q,12y0,,12y1,q,12ys,,12yt,q,12zk,,12zl,q,130c,,130d,q,1314,,1315,q,131w,,131x,q,132o,,132p,q,133g,,133h,q,1348,,1349,q,1350,,1351,q,135s,,135t,q,136k,,136l,q,137c,,137d,q,1384,,1385,q,138w,,138x,q,139o,,139p,q,13ag,,13ah,q,13b8,,13b9,q,13c0,,13c1,q,13cs,,13ct,q,13dk,,13dl,q,13ec,,13ed,q,13f4,,13f5,q,13fw,,13fx,q,13go,,13gp,q,13hg,,13hh,q,13i8,,13i9,q,13j0,,13j1,q,13js,,13jt,q,13kk,,13kl,q,13lc,,13ld,q,13m4,,13m5,q,13mw,,13mx,q,13no,,13np,q,13og,,13oh,q,13p8,,13p9,q,13q0,,13q1,q,13qs,,13qt,q,13rk,,13rl,q,13sc,,13sd,q,13t4,,13t5,q,13tw,,13tx,q,13uo,,13up,q,13vg,,13vh,q,13w8,,13w9,q,13x0,,13x1,q,13xs,,13xt,q,13yk,,13yl,q,13zc,,13zd,q,1404,,1405,q,140w,,140x,q,141o,,141p,q,142g,,142h,q,1438,,1439,q,1440,,1441,q,144s,,144t,q,145k,,145l,q,146c,,146d,q,1474,,1475,q,147w,,147x,q,148o,,148p,q,149g,,149h,q,14a8,,14a9,q,14b0,,14b1,q,14bs,,14bt,q,14ck,,14cl,q,14dc,,14dd,q,14e4,,14e5,q,14ew,,14ex,q,14fo,,14fp,q,14gg,,14gh,q,14h8,,14h9,q,14i0,,14i1,q,14is,,14it,q,14jk,,14jl,q,14kc,,14kd,q,14l4,,14l5,q,14lw,,14lx,q,14mo,,14mp,q,14ng,,14nh,q,14o8,,14o9,q,14p0,,14p1,q,14ps,,14pt,q,14qk,,14ql,q,14rc,,14rd,q,14s4,,14s5,q,14sw,,14sx,q,14to,,14tp,q,14ug,,14uh,q,14v8,,14v9,q,14w0,,14w1,q,14ws,,14wt,q,14xk,,14xl,q,14yc,,14yd,q,14z4,,14z5,q,14zw,,14zx,q,150o,,150p,q,151g,,151h,q,1528,,1529,q,1530,,1531,q,153s,,153t,q,154k,,154l,q,155c,,155d,q,1564,,1565,q,156w,,156x,q,157o,,157p,q,158g,,158h,q,1598,,1599,q,15a0,,15a1,q,15as,,15at,q,15bk,,15bl,q,15cc,,15cd,q,15d4,,15d5,q,15dw,,15dx,q,15eo,,15ep,q,15fg,,15fh,q,15g8,,15g9,q,15h0,,15h1,q,15hs,,15ht,q,15ik,,15il,q,15jc,,15jd,q,15k4,,15k5,q,15kw,,15kx,q,15lo,,15lp,q,15mg,,15mh,q,15n8,,15n9,q,15o0,,15o1,q,15os,,15ot,q,15pk,,15pl,q,15qc,,15qd,q,15r4,,15r5,q,15rw,,15rx,q,15so,,15sp,q,15tg,,15th,q,15u8,,15u9,q,15v0,,15v1,q,15vs,,15vt,q,15wk,,15wl,q,15xc,,15xd,q,15y4,,15y5,q,15yw,,15yx,q,15zo,,15zp,q,160g,,160h,q,1618,,1619,q,1620,,1621,q,162s,,162t,q,163k,,163l,q,164c,,164d,q,1654,,1655,q,165w,,165x,q,166o,,166p,q,167g,,167h,q,1688,,1689,q,1690,,1691,q,169s,,169t,q,16ak,,16al,q,16bc,,16bd,q,16c4,,16c5,q,16cw,,16cx,q,16do,,16dp,q,16eg,,16eh,q,16f8,,16f9,q,16g0,,16g1,q,16gs,,16gt,q,16hk,,16hl,q,16ic,,16id,q,16j4,,16j5,q,16jw,,16jx,q,16ko,,16kp,q,16ls,m,16mj,1c,1dlq,,1e68,f,1e74,f,1edb,,1ehq,1,1ek0,b,1eyl,,1f4w,,1f92,4,1gjl,2,1gjp,1,1gjw,3,1gl4,2,1glb,,1gpx,1,1h5w,3,1h7t,4,1hgr,1,1hj0,3,1hl2,a,1hmq,3,1hq8,,1hq9,,1hqa,,1hrs,e,1htc,,1htf,1,1htr,2,1htu,,1hv4,2,1hv7,3,1hvb,1,1hvd,1,1hvh,,1hvm,,1hvx,,1hxc,2,1hyf,4,1hyk,,1hyl,7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,20jz,,20k1,1i,20lr,3,20o4,,20og,1,2ftp,1,2fts,3,2jgg,19,2jhs,m,2jxh,4,2jxp,5,2jxv,7,2jy3,7,2jyd,6,2jze,3,2k3m,2,2lmo,1i,2lob,1d,2lpx,,2lqc,,2lqz,4,2lr5,e,2mtc,6,2mtk,g,2mu3,6,2mub,1,2mue,4,2mxb,,2n1s,6,2nce,,2ne4,3,2nsc,3,2nzi,1,2ok0,6,2on8,6,2pz4,73,2q6l,2,2q7j,,2q98,5,2q9q,1,2qa6,,2qa9,9,2qb1,1k,2qcm,p,2qdd,e,2qe2,,2qen,,2qeq,8,2qf0,3,2qfd,c1,2qrf,4,2qrk,8t,2r0m,7d,2r9c,3j,2rg4,b,2rit,16,2rkc,3,2rm0,7,2rmi,5,2rns,7,2rou,29,2rrg,1a,2rss,9,2rt3,c8,2scg,sd,jny8,v,jnz4,2n,jo1s,3j,jo5c,6n,joc0,2rz'),
|
|
20
|
-
'262122424333333393233393339333333333393393b3b3b3b3b333b33b3bb33333b3b3333333b3b33bb3333b33b3bb33333b3bbb333b333b33333b3b3b3b3333b3b33b3bb39333b33b33b3b3b333b333333b3b333333b33b3b3333b3335dc333333b3b3b33323333b3bb3b33b3b3b3333b3333b3b333bb3b33b3b3b3b3b333b333b3323e2244234444444444444444444444444444444444444444443333443443333333b3b3bb33333b353b3b3b3b333b3b333b333333b3bb3b3b3bb3787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878dc333232333333333333333b3b3333bb3b393933b3b33bb3b393b3b3b3333b33b33b3bbb33b333b3333bb3933b3b3b333b3b3b3b3b33b3b3b33b3b3b33b3b33b33b3b3b33bb39b9b3b33b3b33b9333b393b3b33b33b3b3b3333393b3b3b33b39bb3b332333b333dd3b33332333323333333333333333333333344444444a44444434444444444444423232',
|
|
21
|
-
);
|
|
22
|
-
|
|
23
|
-
exports.grapheme_ranges = grapheme_ranges;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import { decodeUnicodeData } from './core.js';
|
|
3
|
-
|
|
4
|
-
// The following code was generated by "scripts/unicode.js",
|
|
5
|
-
// DO NOT EDIT DIRECTLY.
|
|
6
|
-
//
|
|
7
|
-
// @ts-check
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* @type {GraphemeCategoryRange[]}
|
|
12
|
-
*/
|
|
13
|
-
const grapheme_ranges = decodeUnicodeData(
|
|
14
|
-
/** @type {UnicodeDataEncoding} */
|
|
15
|
-
(',9,a,,b,1,d,,e,h,3j,w,4p,,4t,,4u,,lc,33,w3,6,13l,18,14v,,14x,1,150,1,153,,16o,5,174,a,17g,,18r,k,19s,,1cm,6,1ct,,1cv,5,1d3,1,1d6,3,1e7,,1e9,,1f4,q,1ie,a,1kb,8,1kt,,1li,3,1ln,8,1lx,2,1m1,4,1nd,2,1ow,1,1p3,8,1qi,n,1r6,,1r7,v,1s3,,1tm,,1tn,,1to,,1tq,2,1tt,7,1u1,3,1u5,,1u6,1,1u9,6,1uq,1,1vl,,1vm,1,1x8,,1xa,,1xb,1,1xd,3,1xj,1,1xn,1,1xp,,1xz,,1ya,1,1z2,,1z5,1,1z7,,20s,,20u,2,20x,1,213,1,217,2,21d,,228,1,22d,,22p,1,22r,,24c,,24e,2,24h,4,24n,1,24p,,24r,1,24t,,25e,1,262,5,269,,26a,1,27w,,27y,1,280,,281,3,287,1,28b,1,28d,,28l,2,28y,1,29u,,2bi,,2bj,,2bk,,2bl,1,2bq,2,2bu,2,2bx,,2c7,,2dc,,2dd,2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z90,,z91,q,z9s,,z9t,q,zak,,zal,q,zbc,,zbd,q,zc4,,zc5,q,zcw,,zcx,q,zdo,,zdp,q,zeg,,zeh,q,zf8,,zf9,q,zg0,,zg1,q,zgs,,zgt,q,zhk,,zhl,q,zic,,zid,q,zj4,,zj5,q,zjw,,zjx,q,zko,,zkp,q,zlg,,zlh,q,zm8,,zm9,q,zn0,,zn1,q,zns,,znt,q,zok,,zol,q,zpc,,zpd,q,zq4,,zq5,q,zqw,,zqx,q,zro,,zrp,q,zsg,,zsh,q,zt8,,zt9,q,zu0,,zu1,q,zus,,zut,q,zvk,,zvl,q,zwc,,zwd,q,zx4,,zx5,q,zxw,,zxx,q,zyo,,zyp,q,zzg,,zzh,q,1008,,1009,q,1010,,1011,q,101s,,101t,q,102k,,102l,q,103c,,103d,q,1044,,1045,q,104w,,104x,q,105o,,105p,q,106g,,106h,q,1078,,1079,q,1080,,1081,q,108s,,108t,q,109k,,109l,q,10ac,,10ad,q,10b4,,10b5,q,10bw,,10bx,q,10co,,10cp,q,10dg,,10dh,q,10e8,,10e9,q,10f0,,10f1,q,10fs,,10ft,q,10gk,,10gl,q,10hc,,10hd,q,10i4,,10i5,q,10iw,,10ix,q,10jo,,10jp,q,10kg,,10kh,q,10l8,,10l9,q,10m0,,10m1,q,10ms,,10mt,q,10nk,,10nl,q,10oc,,10od,q,10p4,,10p5,q,10pw,,10px,q,10qo,,10qp,q,10rg,,10rh,q,10s8,,10s9,q,10t0,,10t1,q,10ts,,10tt,q,10uk,,10ul,q,10vc,,10vd,q,10w4,,10w5,q,10ww,,10wx,q,10xo,,10xp,q,10yg,,10yh,q,10z8,,10z9,q,1100,,1101,q,110s,,110t,q,111k,,111l,q,112c,,112d,q,1134,,1135,q,113w,,113x,q,114o,,114p,q,115g,,115h,q,1168,,1169,q,1170,,1171,q,117s,,117t,q,118k,,118l,q,119c,,119d,q,11a4,,11a5,q,11aw,,11ax,q,11bo,,11bp,q,11cg,,11ch,q,11d8,,11d9,q,11e0,,11e1,q,11es,,11et,q,11fk,,11fl,q,11gc,,11gd,q,11h4,,11h5,q,11hw,,11hx,q,11io,,11ip,q,11jg,,11jh,q,11k8,,11k9,q,11l0,,11l1,q,11ls,,11lt,q,11mk,,11ml,q,11nc,,11nd,q,11o4,,11o5,q,11ow,,11ox,q,11po,,11pp,q,11qg,,11qh,q,11r8,,11r9,q,11s0,,11s1,q,11ss,,11st,q,11tk,,11tl,q,11uc,,11ud,q,11v4,,11v5,q,11vw,,11vx,q,11wo,,11wp,q,11xg,,11xh,q,11y8,,11y9,q,11z0,,11z1,q,11zs,,11zt,q,120k,,120l,q,121c,,121d,q,1224,,1225,q,122w,,122x,q,123o,,123p,q,124g,,124h,q,1258,,1259,q,1260,,1261,q,126s,,126t,q,127k,,127l,q,128c,,128d,q,1294,,1295,q,129w,,129x,q,12ao,,12ap,q,12bg,,12bh,q,12c8,,12c9,q,12d0,,12d1,q,12ds,,12dt,q,12ek,,12el,q,12fc,,12fd,q,12g4,,12g5,q,12gw,,12gx,q,12ho,,12hp,q,12ig,,12ih,q,12j8,,12j9,q,12k0,,12k1,q,12ks,,12kt,q,12lk,,12ll,q,12mc,,12md,q,12n4,,12n5,q,12nw,,12nx,q,12oo,,12op,q,12pg,,12ph,q,12q8,,12q9,q,12r0,,12r1,q,12rs,,12rt,q,12sk,,12sl,q,12tc,,12td,q,12u4,,12u5,q,12uw,,12ux,q,12vo,,12vp,q,12wg,,12wh,q,12x8,,12x9,q,12y0,,12y1,q,12ys,,12yt,q,12zk,,12zl,q,130c,,130d,q,1314,,1315,q,131w,,131x,q,132o,,132p,q,133g,,133h,q,1348,,1349,q,1350,,1351,q,135s,,135t,q,136k,,136l,q,137c,,137d,q,1384,,1385,q,138w,,138x,q,139o,,139p,q,13ag,,13ah,q,13b8,,13b9,q,13c0,,13c1,q,13cs,,13ct,q,13dk,,13dl,q,13ec,,13ed,q,13f4,,13f5,q,13fw,,13fx,q,13go,,13gp,q,13hg,,13hh,q,13i8,,13i9,q,13j0,,13j1,q,13js,,13jt,q,13kk,,13kl,q,13lc,,13ld,q,13m4,,13m5,q,13mw,,13mx,q,13no,,13np,q,13og,,13oh,q,13p8,,13p9,q,13q0,,13q1,q,13qs,,13qt,q,13rk,,13rl,q,13sc,,13sd,q,13t4,,13t5,q,13tw,,13tx,q,13uo,,13up,q,13vg,,13vh,q,13w8,,13w9,q,13x0,,13x1,q,13xs,,13xt,q,13yk,,13yl,q,13zc,,13zd,q,1404,,1405,q,140w,,140x,q,141o,,141p,q,142g,,142h,q,1438,,1439,q,1440,,1441,q,144s,,144t,q,145k,,145l,q,146c,,146d,q,1474,,1475,q,147w,,147x,q,148o,,148p,q,149g,,149h,q,14a8,,14a9,q,14b0,,14b1,q,14bs,,14bt,q,14ck,,14cl,q,14dc,,14dd,q,14e4,,14e5,q,14ew,,14ex,q,14fo,,14fp,q,14gg,,14gh,q,14h8,,14h9,q,14i0,,14i1,q,14is,,14it,q,14jk,,14jl,q,14kc,,14kd,q,14l4,,14l5,q,14lw,,14lx,q,14mo,,14mp,q,14ng,,14nh,q,14o8,,14o9,q,14p0,,14p1,q,14ps,,14pt,q,14qk,,14ql,q,14rc,,14rd,q,14s4,,14s5,q,14sw,,14sx,q,14to,,14tp,q,14ug,,14uh,q,14v8,,14v9,q,14w0,,14w1,q,14ws,,14wt,q,14xk,,14xl,q,14yc,,14yd,q,14z4,,14z5,q,14zw,,14zx,q,150o,,150p,q,151g,,151h,q,1528,,1529,q,1530,,1531,q,153s,,153t,q,154k,,154l,q,155c,,155d,q,1564,,1565,q,156w,,156x,q,157o,,157p,q,158g,,158h,q,1598,,1599,q,15a0,,15a1,q,15as,,15at,q,15bk,,15bl,q,15cc,,15cd,q,15d4,,15d5,q,15dw,,15dx,q,15eo,,15ep,q,15fg,,15fh,q,15g8,,15g9,q,15h0,,15h1,q,15hs,,15ht,q,15ik,,15il,q,15jc,,15jd,q,15k4,,15k5,q,15kw,,15kx,q,15lo,,15lp,q,15mg,,15mh,q,15n8,,15n9,q,15o0,,15o1,q,15os,,15ot,q,15pk,,15pl,q,15qc,,15qd,q,15r4,,15r5,q,15rw,,15rx,q,15so,,15sp,q,15tg,,15th,q,15u8,,15u9,q,15v0,,15v1,q,15vs,,15vt,q,15wk,,15wl,q,15xc,,15xd,q,15y4,,15y5,q,15yw,,15yx,q,15zo,,15zp,q,160g,,160h,q,1618,,1619,q,1620,,1621,q,162s,,162t,q,163k,,163l,q,164c,,164d,q,1654,,1655,q,165w,,165x,q,166o,,166p,q,167g,,167h,q,1688,,1689,q,1690,,1691,q,169s,,169t,q,16ak,,16al,q,16bc,,16bd,q,16c4,,16c5,q,16cw,,16cx,q,16do,,16dp,q,16eg,,16eh,q,16f8,,16f9,q,16g0,,16g1,q,16gs,,16gt,q,16hk,,16hl,q,16ic,,16id,q,16j4,,16j5,q,16jw,,16jx,q,16ko,,16kp,q,16ls,m,16mj,1c,1dlq,,1e68,f,1e74,f,1edb,,1ehq,1,1ek0,b,1eyl,,1f4w,,1f92,4,1gjl,2,1gjp,1,1gjw,3,1gl4,2,1glb,,1gpx,1,1h5w,3,1h7t,4,1hgr,1,1hj0,3,1hl2,a,1hmq,3,1hq8,,1hq9,,1hqa,,1hrs,e,1htc,,1htf,1,1htr,2,1htu,,1hv4,2,1hv7,3,1hvb,1,1hvd,1,1hvh,,1hvm,,1hvx,,1hxc,2,1hyf,4,1hyk,,1hyl,7,1hz9,1,1i0j,,1i0w,1,1i0y,,1i2b,2,1i2e,8,1i2n,,1i2o,,1i2q,1,1i2x,3,1i32,,1i33,,1i5o,2,1i5r,2,1i5u,1,1i5w,3,1i66,,1i69,,1ian,,1iao,2,1iar,7,1ibk,1,1ibm,1,1id7,1,1ida,,1idb,,1idc,,1idd,3,1idj,1,1idn,1,1idp,,1idz,,1iea,1,1iee,6,1ieo,4,1igo,,1igp,1,1igr,5,1igy,,1ih1,,1ih3,2,1ih6,,1ih8,1,1iha,2,1ihd,,1ihe,,1iht,1,1ik5,2,1ik8,7,1ikg,1,1iki,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eq,8,2qf0,3,2qfd,c1,2qrf,4,2qrk,8t,2r0m,7d,2r9c,3j,2rg4,b,2rit,16,2rkc,3,2rm0,7,2rmi,5,2rns,7,2rou,29,2rrg,1a,2rss,9,2rt3,c8,2scg,sd,jny8,v,jnz4,2n,jo1s,3j,jo5c,6n,joc0,2rz'),
|
|
16
|
-
'262122424333333393233393339333333333393393b3b3b3b3b333b33b3bb33333b3b3333333b3b33bb3333b33b3bb33333b3bbb333b333b33333b3b3b3b3333b3b33b3bb39333b33b33b3b3b333b333333b3b333333b33b3b3333b3335dc333333b3b3b33323333b3bb3b33b3b3b3333b3333b3b333bb3b33b3b3b3b3b333b333b3323e2244234444444444444444444444444444444444444444443333443443333333b3b3bb33333b353b3b3b3b333b3b333b333333b3bb3b3b3bb3787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878dc333232333333333333333b3b3333bb3b393933b3b33bb3b393b3b3b3333b33b33b3bbb33b333b3333bb3933b3b3b333b3b3b3b3b33b3b3b33b3b3b33b3b33b33b3b3b33bb39b9b3b33b3b33b9333b393b3b33b33b3b3b3333393b3b3b33b39bb3b332333b333dd3b33332333323333333333333333333333344444444a44444434444444444444423232',
|
|
17
|
-
);
|
|
18
|
-
|
|
19
|
-
export { grapheme_ranges };
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
'use strict';
|
|
3
|
-
|
|
4
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
5
|
-
|
|
6
|
-
const core = require('./core.cjs');
|
|
7
|
-
|
|
8
|
-
// The following code was generated by "scripts/unicode.js",
|
|
9
|
-
// DO NOT EDIT DIRECTLY.
|
|
10
|
-
//
|
|
11
|
-
// @ts-check
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* @typedef {import('./core.js').UnicodeRange} UnicodeRange
|
|
16
|
-
* @typedef {import('./core.js').UnicodeDataEncoding} UnicodeDataEncoding
|
|
17
|
-
*/
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* The Unicode `Indic_Conjunct_Break=Consonant` derived property table
|
|
21
|
-
*
|
|
22
|
-
* @type {UnicodeRange[]}
|
|
23
|
-
*/
|
|
24
|
-
const consonant_ranges = core.decodeUnicodeData(
|
|
25
|
-
/** @type {UnicodeDataEncoding} */
|
|
26
|
-
('1sl,10,1ug,7,1vc,7,1w5,j,1wq,6,1wy,,1x2,3,1y4,1,1y7,,1yo,1,239,j,23u,6,242,1,245,4,261,,26t,j,27e,6,27m,1,27p,4,28s,1,28v,,29d,,2dx,j,2ei,f,2fs,2,2l1,11')
|
|
27
|
-
);
|
|
28
|
-
|
|
29
|
-
exports.consonant_ranges = consonant_ranges;
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import { decodeUnicodeData } from './core.js';
|
|
3
|
-
|
|
4
|
-
// The following code was generated by "scripts/unicode.js",
|
|
5
|
-
// DO NOT EDIT DIRECTLY.
|
|
6
|
-
//
|
|
7
|
-
// @ts-check
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* @typedef {import('./core.js').UnicodeRange} UnicodeRange
|
|
12
|
-
* @typedef {import('./core.js').UnicodeDataEncoding} UnicodeDataEncoding
|
|
13
|
-
*/
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* The Unicode `Indic_Conjunct_Break=Consonant` derived property table
|
|
17
|
-
*
|
|
18
|
-
* @type {UnicodeRange[]}
|
|
19
|
-
*/
|
|
20
|
-
const consonant_ranges = decodeUnicodeData(
|
|
21
|
-
/** @type {UnicodeDataEncoding} */
|
|
22
|
-
('1sl,10,1ug,7,1vc,7,1w5,j,1wq,6,1wy,,1x2,3,1y4,1,1y7,,1yo,1,239,j,23u,6,242,1,245,4,261,,26t,j,27e,6,27m,1,27p,4,28s,1,28v,,29d,,2dx,j,2ei,f,2fs,2,2l1,11')
|
|
23
|
-
);
|
|
24
|
-
|
|
25
|
-
export { consonant_ranges };
|
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
'use strict';
|
|
3
|
-
|
|
4
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
5
|
-
|
|
6
|
-
// @ts-check
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* @template {number} [T=number]
|
|
10
|
-
* @typedef {[from: number, to: number, category: T]} CategorizedUnicodeRange
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* @typedef {CategorizedUnicodeRange<0>} UnicodeRange
|
|
15
|
-
*/
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* @typedef {string & { __tag: 'UnicodeDataEncoding' }} UnicodeDataEncoding
|
|
19
|
-
*
|
|
20
|
-
* Encoding for array of {@link UnicodeRange}, items separated by comma.
|
|
21
|
-
*
|
|
22
|
-
* Each {@link UnicodeDataRow} packed as a base36 integer:
|
|
23
|
-
*
|
|
24
|
-
* padding = to - from
|
|
25
|
-
* encoding = base36(from) + ',' + base36(padding)
|
|
26
|
-
*
|
|
27
|
-
* Notes:
|
|
28
|
-
* - base36 can hold surprisingly large numbers in a few characters.
|
|
29
|
-
* - The biggest codepoint is 0xE01F0 (918,000) at this point
|
|
30
|
-
* - The max value of a category is 23; https://www.unicode.org/reports/tr29/tr29-45.html#Table_Word_Break_Property_Values
|
|
31
|
-
* - The longest range is 42,720; CJK UNIFIED IDEOGRAPH-20000..CJK UNIFIED IDEOGRAPH-2A6DF
|
|
32
|
-
*/
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
* @template {number} [T=number]
|
|
36
|
-
* @param {UnicodeDataEncoding} data
|
|
37
|
-
* @param {string} [cats='']
|
|
38
|
-
* @returns {Array<CategorizedUnicodeRange<T>>}
|
|
39
|
-
*/
|
|
40
|
-
function decodeUnicodeData(data, cats = '') {
|
|
41
|
-
let buf = /** @type {Array<CategorizedUnicodeRange<T>>} */([])
|
|
42
|
-
, nums = data.split(',').map(s => s ? parseInt(s, 36) : 0)
|
|
43
|
-
, n = 0;
|
|
44
|
-
for (let i = 0; i < nums.length; i++)
|
|
45
|
-
i % 2
|
|
46
|
-
? buf.push([n, n + nums[i], /** @type {T} */ (cats ? parseInt(cats[i >> 1], 36) : 0)])
|
|
47
|
-
: n = nums[i];
|
|
48
|
-
return buf;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
/**
|
|
52
|
-
* @template {object} Ext
|
|
53
|
-
* @typedef {{
|
|
54
|
-
* segment: string,
|
|
55
|
-
* index: number,
|
|
56
|
-
* input: string,
|
|
57
|
-
* } & Ext} SegmentOutput
|
|
58
|
-
*/
|
|
59
|
-
|
|
60
|
-
/**
|
|
61
|
-
* @template {object} T
|
|
62
|
-
* @typedef {IterableIterator<SegmentOutput<T>>} Segmenter
|
|
63
|
-
*/
|
|
64
|
-
|
|
65
|
-
/**
|
|
66
|
-
* @template {number} [T=number]
|
|
67
|
-
* @param {number} cp
|
|
68
|
-
* @param {CategorizedUnicodeRange<T>[]} ranges
|
|
69
|
-
* @return {number} index of matched unicode range, or -1 if no match
|
|
70
|
-
*/
|
|
71
|
-
function findUnicodeRangeIndex(cp, ranges, lo = 0, hi = ranges.length - 1) {
|
|
72
|
-
while (lo <= hi) {
|
|
73
|
-
let mid = lo + hi >>> 1
|
|
74
|
-
, range = ranges[mid];
|
|
75
|
-
if (cp < range[0]) hi = mid - 1;
|
|
76
|
-
else if (cp > range[1]) lo = mid + 1;
|
|
77
|
-
else return mid;
|
|
78
|
-
}
|
|
79
|
-
return -1;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
exports.decodeUnicodeData = decodeUnicodeData;
|
|
83
|
-
exports.findUnicodeRangeIndex = findUnicodeRangeIndex;
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
// @ts-check
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* @template {number} [T=number]
|
|
6
|
-
* @typedef {[from: number, to: number, category: T]} CategorizedUnicodeRange
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* @typedef {CategorizedUnicodeRange<0>} UnicodeRange
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* @typedef {string & { __tag: 'UnicodeDataEncoding' }} UnicodeDataEncoding
|
|
15
|
-
*
|
|
16
|
-
* Encoding for array of {@link UnicodeRange}, items separated by comma.
|
|
17
|
-
*
|
|
18
|
-
* Each {@link UnicodeDataRow} packed as a base36 integer:
|
|
19
|
-
*
|
|
20
|
-
* padding = to - from
|
|
21
|
-
* encoding = base36(from) + ',' + base36(padding)
|
|
22
|
-
*
|
|
23
|
-
* Notes:
|
|
24
|
-
* - base36 can hold surprisingly large numbers in a few characters.
|
|
25
|
-
* - The biggest codepoint is 0xE01F0 (918,000) at this point
|
|
26
|
-
* - The max value of a category is 23; https://www.unicode.org/reports/tr29/tr29-45.html#Table_Word_Break_Property_Values
|
|
27
|
-
* - The longest range is 42,720; CJK UNIFIED IDEOGRAPH-20000..CJK UNIFIED IDEOGRAPH-2A6DF
|
|
28
|
-
*/
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* @template {number} [T=number]
|
|
32
|
-
* @param {UnicodeDataEncoding} data
|
|
33
|
-
* @param {string} [cats='']
|
|
34
|
-
* @returns {Array<CategorizedUnicodeRange<T>>}
|
|
35
|
-
*/
|
|
36
|
-
function decodeUnicodeData(data, cats = '') {
|
|
37
|
-
let buf = /** @type {Array<CategorizedUnicodeRange<T>>} */([])
|
|
38
|
-
, nums = data.split(',').map(s => s ? parseInt(s, 36) : 0)
|
|
39
|
-
, n = 0;
|
|
40
|
-
for (let i = 0; i < nums.length; i++)
|
|
41
|
-
i % 2
|
|
42
|
-
? buf.push([n, n + nums[i], /** @type {T} */ (cats ? parseInt(cats[i >> 1], 36) : 0)])
|
|
43
|
-
: n = nums[i];
|
|
44
|
-
return buf;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
/**
|
|
48
|
-
* @template {object} Ext
|
|
49
|
-
* @typedef {{
|
|
50
|
-
* segment: string,
|
|
51
|
-
* index: number,
|
|
52
|
-
* input: string,
|
|
53
|
-
* } & Ext} SegmentOutput
|
|
54
|
-
*/
|
|
55
|
-
|
|
56
|
-
/**
|
|
57
|
-
* @template {object} T
|
|
58
|
-
* @typedef {IterableIterator<SegmentOutput<T>>} Segmenter
|
|
59
|
-
*/
|
|
60
|
-
|
|
61
|
-
/**
|
|
62
|
-
* @template {number} [T=number]
|
|
63
|
-
* @param {number} cp
|
|
64
|
-
* @param {CategorizedUnicodeRange<T>[]} ranges
|
|
65
|
-
* @return {number} index of matched unicode range, or -1 if no match
|
|
66
|
-
*/
|
|
67
|
-
function findUnicodeRangeIndex(cp, ranges, lo = 0, hi = ranges.length - 1) {
|
|
68
|
-
while (lo <= hi) {
|
|
69
|
-
let mid = lo + hi >>> 1
|
|
70
|
-
, range = ranges[mid];
|
|
71
|
-
if (cp < range[0]) hi = mid - 1;
|
|
72
|
-
else if (cp > range[1]) lo = mid + 1;
|
|
73
|
-
else return mid;
|
|
74
|
-
}
|
|
75
|
-
return -1;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
export { decodeUnicodeData, findUnicodeRangeIndex };
|
|
@@ -1,312 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
'use strict';
|
|
3
|
-
|
|
4
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
5
|
-
|
|
6
|
-
const core = require('./core.cjs');
|
|
7
|
-
const _grapheme_data = require('./_grapheme_data.cjs');
|
|
8
|
-
const _incb_data = require('./_incb_data.cjs');
|
|
9
|
-
|
|
10
|
-
// Copyright 2012-2018 The Rust Project Developers. See the COPYRIGHT
|
|
11
|
-
// file at the top-level directory of this distribution and at
|
|
12
|
-
// http://rust-lang.org/COPYRIGHT.
|
|
13
|
-
//
|
|
14
|
-
// Licensed under the MIT license
|
|
15
|
-
// <LICENSE-MIT or http://opensource.org/licenses/MIT>.
|
|
16
|
-
//
|
|
17
|
-
// Modified original Rust library [source code]
|
|
18
|
-
// (https://github.com/unicode-rs/unicode-segmentation/blob/1f88570/src/grapheme.rs)
|
|
19
|
-
//
|
|
20
|
-
// to create JavaScript library [unicode-segmenter]
|
|
21
|
-
// (https://github.com/cometkim/unicode-segmenter)
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
const BMP_MAX = 0xFFFF;
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* Unicode segmentation by extended grapheme rules.
|
|
28
|
-
*
|
|
29
|
-
* This is fully compatible with the {@link Intl.Segmenter.segment} API
|
|
30
|
-
* @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Segmenter/segment
|
|
31
|
-
*
|
|
32
|
-
* @param {string} input
|
|
33
|
-
* @return {GraphemeSegmenter} iterator for grapheme cluster segments
|
|
34
|
-
*/
|
|
35
|
-
function* graphemeSegments(input) {
|
|
36
|
-
let cp = input.codePointAt(0);
|
|
37
|
-
|
|
38
|
-
// do nothing on empty string
|
|
39
|
-
if (cp == null) return;
|
|
40
|
-
|
|
41
|
-
/** Current cursor position. */
|
|
42
|
-
let cursor = cp <= BMP_MAX ? 1 : 2;
|
|
43
|
-
|
|
44
|
-
/** Total length of the input string. */
|
|
45
|
-
let len = input.length;
|
|
46
|
-
|
|
47
|
-
/** @type {import('./_grapheme_data.js').GraphemeCategoryRange} */
|
|
48
|
-
let cache = [0, 0, 2 /* GC_Control */];
|
|
49
|
-
|
|
50
|
-
/** Category of codepoint immediately preceding cursor */
|
|
51
|
-
let catBefore = cat(cp, cache);
|
|
52
|
-
|
|
53
|
-
/** @type {GraphemeCategoryNum | null} Category of codepoint immediately preceding cursor. */
|
|
54
|
-
let catAfter = null;
|
|
55
|
-
|
|
56
|
-
/** The number of RIS codepoints preceding `cursor`. */
|
|
57
|
-
let risCount = 0;
|
|
58
|
-
|
|
59
|
-
/** Emoji state */
|
|
60
|
-
let emoji = false;
|
|
61
|
-
|
|
62
|
-
/** InCB=Consonant */
|
|
63
|
-
let consonant = false;
|
|
64
|
-
|
|
65
|
-
/** InCB=Linker */
|
|
66
|
-
let linker = false;
|
|
67
|
-
|
|
68
|
-
/** InCB=Consonant InCB=Linker x InCB=Consonant */
|
|
69
|
-
let incb = false;
|
|
70
|
-
|
|
71
|
-
let index = 0;
|
|
72
|
-
|
|
73
|
-
/** Beginning category of a segment */
|
|
74
|
-
let _catBegin = catBefore;
|
|
75
|
-
|
|
76
|
-
/** Memoize the beginnig code point a the segment. */
|
|
77
|
-
let _hd = cp;
|
|
78
|
-
|
|
79
|
-
while (cursor < len) {
|
|
80
|
-
// Note: Lazily update `consonant` and `linker` state
|
|
81
|
-
// which is a extra overhead only for Hindi text.
|
|
82
|
-
if (cp >= 2325) {
|
|
83
|
-
if (!consonant && catBefore === 0) {
|
|
84
|
-
consonant = isIndicConjunctConsonant(cp);
|
|
85
|
-
} else if (catBefore === 3 /* Extend */) {
|
|
86
|
-
// Note: \p{InCB=Linker} is a subset of \p{Extend}
|
|
87
|
-
linker = isIndicConjunctLinker(cp);
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
cp = /** @type {number} */ (input.codePointAt(cursor));
|
|
92
|
-
catAfter = cat(cp, cache);
|
|
93
|
-
|
|
94
|
-
if (catBefore === 10 /* Regional_Indicator */) {
|
|
95
|
-
risCount++;
|
|
96
|
-
} else {
|
|
97
|
-
risCount = 0;
|
|
98
|
-
if (
|
|
99
|
-
catAfter === 14 /* ZWJ */
|
|
100
|
-
&& (catBefore === 3 /* Extend */ || catBefore === 4 /* Extended_Pictographic */)
|
|
101
|
-
) {
|
|
102
|
-
emoji = true;
|
|
103
|
-
|
|
104
|
-
} else if (catAfter === 0 /* Any */ && cp >= 2325) {
|
|
105
|
-
// Note: Put GB9c rule checking here to reduce.
|
|
106
|
-
incb = consonant && linker && (consonant = isIndicConjunctConsonant(cp));
|
|
107
|
-
// It cannot be both a linker and a consonant.
|
|
108
|
-
linker = linker && !consonant;
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
if (isBoundary(catBefore, catAfter, risCount, emoji, incb)) {
|
|
113
|
-
yield {
|
|
114
|
-
segment: input.slice(index, cursor),
|
|
115
|
-
index,
|
|
116
|
-
input,
|
|
117
|
-
_hd,
|
|
118
|
-
_catBegin,
|
|
119
|
-
_catEnd: catBefore,
|
|
120
|
-
};
|
|
121
|
-
|
|
122
|
-
// flush
|
|
123
|
-
emoji = false;
|
|
124
|
-
incb = false;
|
|
125
|
-
index = cursor;
|
|
126
|
-
_catBegin = catAfter;
|
|
127
|
-
_hd = cp;
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
cursor += cp <= BMP_MAX ? 1 : 2;
|
|
131
|
-
catBefore = catAfter;
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
if (index < len) {
|
|
135
|
-
yield {
|
|
136
|
-
segment: input.slice(index),
|
|
137
|
-
index,
|
|
138
|
-
input,
|
|
139
|
-
_hd,
|
|
140
|
-
_catBegin,
|
|
141
|
-
_catEnd: catBefore,
|
|
142
|
-
};
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
/**
|
|
147
|
-
* Split given text into extended grapheme clusters.
|
|
148
|
-
*
|
|
149
|
-
* @param {string} text
|
|
150
|
-
* @return {IterableIterator<string>} iterator for grapheme clusters
|
|
151
|
-
*
|
|
152
|
-
* @see {@link graphemeSegments} if you need extra information.
|
|
153
|
-
*
|
|
154
|
-
* @example
|
|
155
|
-
* [...splitGraphemes('abc')] // => ['a', 'b', 'c']
|
|
156
|
-
*/
|
|
157
|
-
function* splitGraphemes(text) {
|
|
158
|
-
for (let s of graphemeSegments(text)) yield s.segment;
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
/**
|
|
162
|
-
* Precompute a fast lookup table for BMP code points (0..0xFFFF)
|
|
163
|
-
* This table maps each code point to its Grapheme_Cluster_Break category.
|
|
164
|
-
* It is generated once at module load time using the grapheme_ranges data.
|
|
165
|
-
* The table is a Uint8Array of length 0x10000 (64KB), which is acceptable in memory.
|
|
166
|
-
* For code points >= 0x10000 we fall back to binary search.
|
|
167
|
-
*/
|
|
168
|
-
let bmpLookup = new Uint8Array(BMP_MAX + 1);
|
|
169
|
-
let bmpCursor = (() => {
|
|
170
|
-
let cursor = 0;
|
|
171
|
-
let cp = 0;
|
|
172
|
-
while (cp <= BMP_MAX) {
|
|
173
|
-
let range = _grapheme_data.grapheme_ranges[cursor++];
|
|
174
|
-
for (cp = range[0]; cp <= range[1]; cp++) {
|
|
175
|
-
bmpLookup[cp] = range[2];
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
return cursor;
|
|
179
|
-
})();
|
|
180
|
-
|
|
181
|
-
/**
|
|
182
|
-
* `Grapheme_Cluster_Break` property value of a given codepoint
|
|
183
|
-
*
|
|
184
|
-
* @see https://www.unicode.org/reports/tr29/tr29-43.html#Default_Grapheme_Cluster_Table
|
|
185
|
-
*
|
|
186
|
-
* @param {number} cp
|
|
187
|
-
* @param {import('./_grapheme_data.js').GraphemeCategoryRange} cache
|
|
188
|
-
* @return {GraphemeCategoryNum}
|
|
189
|
-
*/
|
|
190
|
-
function cat(cp, cache) {
|
|
191
|
-
// Fast lookup for BMP (0x0000..0xFFFF) using precomputed table
|
|
192
|
-
if (cp <= BMP_MAX) {
|
|
193
|
-
return /** @type {GraphemeCategoryNum} */ (bmpLookup[cp]);
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
// Use cached result
|
|
197
|
-
if (cp >= cache[0] && cp <= cache[1]) {
|
|
198
|
-
return cache[2];
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
// Binary search, starting from bmpCursor
|
|
202
|
-
let index = core.findUnicodeRangeIndex(cp, _grapheme_data.grapheme_ranges, bmpCursor);
|
|
203
|
-
if (index < 0) {
|
|
204
|
-
return 0;
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
const range = _grapheme_data.grapheme_ranges[index];
|
|
208
|
-
cache[0] = range[0];
|
|
209
|
-
cache[1] = range[1];
|
|
210
|
-
return (cache[2] = range[2]);
|
|
211
|
-
}
|
|
212
|
-
/**
|
|
213
|
-
* @param {number} cp
|
|
214
|
-
* @return {boolean}
|
|
215
|
-
*/
|
|
216
|
-
function isIndicConjunctConsonant(cp) {
|
|
217
|
-
return core.findUnicodeRangeIndex(cp, _incb_data.consonant_ranges) >= 0;
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
/**
|
|
221
|
-
* @param {number} cp
|
|
222
|
-
* @return {boolean}
|
|
223
|
-
*/
|
|
224
|
-
function isIndicConjunctLinker(cp) {
|
|
225
|
-
return (
|
|
226
|
-
cp === 2381 /* 0x094D */ ||
|
|
227
|
-
cp === 2509 /* 0x09CD */ ||
|
|
228
|
-
cp === 2765 /* 0x0ACD */ ||
|
|
229
|
-
cp === 2893 /* 0x0B4D */ ||
|
|
230
|
-
cp === 3149 /* 0x0C4D */ ||
|
|
231
|
-
cp === 3405 /* 0x0D4D */
|
|
232
|
-
);
|
|
233
|
-
}
|
|
234
|
-
|
|
235
|
-
/**
|
|
236
|
-
* @param {GraphemeCategoryNum} catBefore
|
|
237
|
-
* @param {GraphemeCategoryNum} catAfter
|
|
238
|
-
* @param {number} risCount Regional_Indicator state
|
|
239
|
-
* @param {boolean} emoji Extended_Pictographic state
|
|
240
|
-
* @param {boolean} incb Indic_Conjunct_Break state
|
|
241
|
-
* @return {boolean}
|
|
242
|
-
*
|
|
243
|
-
* @see https://www.unicode.org/reports/tr29/tr29-43.html#Grapheme_Cluster_Boundary_Rules
|
|
244
|
-
*/
|
|
245
|
-
function isBoundary(catBefore, catAfter, risCount, emoji, incb) {
|
|
246
|
-
// GB3
|
|
247
|
-
if (catBefore === 1 && catAfter === 6) {
|
|
248
|
-
return false;
|
|
249
|
-
}
|
|
250
|
-
|
|
251
|
-
// GB4
|
|
252
|
-
if (catBefore === 1 || catBefore === 2 || catBefore === 6) {
|
|
253
|
-
return true;
|
|
254
|
-
}
|
|
255
|
-
|
|
256
|
-
// GB5
|
|
257
|
-
if (catAfter === 1 || catAfter === 2 || catAfter === 6) {
|
|
258
|
-
return true;
|
|
259
|
-
}
|
|
260
|
-
|
|
261
|
-
// Most common cases - GB9, GB9a extend rules
|
|
262
|
-
if (catAfter === 3 || catAfter === 14 || catAfter === 11) {
|
|
263
|
-
return false;
|
|
264
|
-
}
|
|
265
|
-
|
|
266
|
-
// GB6 - L x (L | V | LV | LVT)
|
|
267
|
-
if (catBefore === 5) {
|
|
268
|
-
return !(catAfter === 5 || catAfter === 7 || catAfter === 8 || catAfter === 13);
|
|
269
|
-
}
|
|
270
|
-
|
|
271
|
-
// GB7 - (LV | V) x (V | T)
|
|
272
|
-
if (
|
|
273
|
-
(catBefore === 7 || catBefore === 13) &&
|
|
274
|
-
(catAfter === 13 || catAfter === 12)
|
|
275
|
-
) {
|
|
276
|
-
return false;
|
|
277
|
-
}
|
|
278
|
-
|
|
279
|
-
// GB8 - (LVT | T) x T
|
|
280
|
-
if (
|
|
281
|
-
(catBefore === 8 || catBefore === 12) &&
|
|
282
|
-
catAfter === 12
|
|
283
|
-
) {
|
|
284
|
-
return false;
|
|
285
|
-
}
|
|
286
|
-
|
|
287
|
-
// GB9b
|
|
288
|
-
if (catBefore === 9) {
|
|
289
|
-
return false;
|
|
290
|
-
}
|
|
291
|
-
|
|
292
|
-
// GB9c
|
|
293
|
-
if (catAfter === 0 && incb) {
|
|
294
|
-
return false;
|
|
295
|
-
}
|
|
296
|
-
|
|
297
|
-
// GB11
|
|
298
|
-
if (catBefore === 14 && catAfter === 4) {
|
|
299
|
-
return !emoji;
|
|
300
|
-
}
|
|
301
|
-
|
|
302
|
-
// GB12, GB13
|
|
303
|
-
if (catBefore === 10 && catAfter === 10) {
|
|
304
|
-
return risCount % 2 === 0;
|
|
305
|
-
}
|
|
306
|
-
|
|
307
|
-
// GB999
|
|
308
|
-
return true;
|
|
309
|
-
}
|
|
310
|
-
|
|
311
|
-
exports.graphemeSegments = graphemeSegments;
|
|
312
|
-
exports.splitGraphemes = splitGraphemes;
|
|
@@ -1,307 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import { findUnicodeRangeIndex } from './core.js';
|
|
3
|
-
import { grapheme_ranges } from './_grapheme_data.js';
|
|
4
|
-
import { consonant_ranges } from './_incb_data.js';
|
|
5
|
-
|
|
6
|
-
// Copyright 2012-2018 The Rust Project Developers. See the COPYRIGHT
|
|
7
|
-
// file at the top-level directory of this distribution and at
|
|
8
|
-
// http://rust-lang.org/COPYRIGHT.
|
|
9
|
-
//
|
|
10
|
-
// Licensed under the MIT license
|
|
11
|
-
// <LICENSE-MIT or http://opensource.org/licenses/MIT>.
|
|
12
|
-
//
|
|
13
|
-
// Modified original Rust library [source code]
|
|
14
|
-
// (https://github.com/unicode-rs/unicode-segmentation/blob/1f88570/src/grapheme.rs)
|
|
15
|
-
//
|
|
16
|
-
// to create JavaScript library [unicode-segmenter]
|
|
17
|
-
// (https://github.com/cometkim/unicode-segmenter)
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
const BMP_MAX = 0xFFFF;
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* Unicode segmentation by extended grapheme rules.
|
|
24
|
-
*
|
|
25
|
-
* This is fully compatible with the {@link Intl.Segmenter.segment} API
|
|
26
|
-
* @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Segmenter/segment
|
|
27
|
-
*
|
|
28
|
-
* @param {string} input
|
|
29
|
-
* @return {GraphemeSegmenter} iterator for grapheme cluster segments
|
|
30
|
-
*/
|
|
31
|
-
function* graphemeSegments(input) {
|
|
32
|
-
let cp = input.codePointAt(0);
|
|
33
|
-
|
|
34
|
-
// do nothing on empty string
|
|
35
|
-
if (cp == null) return;
|
|
36
|
-
|
|
37
|
-
/** Current cursor position. */
|
|
38
|
-
let cursor = cp <= BMP_MAX ? 1 : 2;
|
|
39
|
-
|
|
40
|
-
/** Total length of the input string. */
|
|
41
|
-
let len = input.length;
|
|
42
|
-
|
|
43
|
-
/** @type {import('./_grapheme_data.js').GraphemeCategoryRange} */
|
|
44
|
-
let cache = [0, 0, 2 /* GC_Control */];
|
|
45
|
-
|
|
46
|
-
/** Category of codepoint immediately preceding cursor */
|
|
47
|
-
let catBefore = cat(cp, cache);
|
|
48
|
-
|
|
49
|
-
/** @type {GraphemeCategoryNum | null} Category of codepoint immediately preceding cursor. */
|
|
50
|
-
let catAfter = null;
|
|
51
|
-
|
|
52
|
-
/** The number of RIS codepoints preceding `cursor`. */
|
|
53
|
-
let risCount = 0;
|
|
54
|
-
|
|
55
|
-
/** Emoji state */
|
|
56
|
-
let emoji = false;
|
|
57
|
-
|
|
58
|
-
/** InCB=Consonant */
|
|
59
|
-
let consonant = false;
|
|
60
|
-
|
|
61
|
-
/** InCB=Linker */
|
|
62
|
-
let linker = false;
|
|
63
|
-
|
|
64
|
-
/** InCB=Consonant InCB=Linker x InCB=Consonant */
|
|
65
|
-
let incb = false;
|
|
66
|
-
|
|
67
|
-
let index = 0;
|
|
68
|
-
|
|
69
|
-
/** Beginning category of a segment */
|
|
70
|
-
let _catBegin = catBefore;
|
|
71
|
-
|
|
72
|
-
/** Memoize the beginnig code point a the segment. */
|
|
73
|
-
let _hd = cp;
|
|
74
|
-
|
|
75
|
-
while (cursor < len) {
|
|
76
|
-
// Note: Lazily update `consonant` and `linker` state
|
|
77
|
-
// which is a extra overhead only for Hindi text.
|
|
78
|
-
if (cp >= 2325) {
|
|
79
|
-
if (!consonant && catBefore === 0) {
|
|
80
|
-
consonant = isIndicConjunctConsonant(cp);
|
|
81
|
-
} else if (catBefore === 3 /* Extend */) {
|
|
82
|
-
// Note: \p{InCB=Linker} is a subset of \p{Extend}
|
|
83
|
-
linker = isIndicConjunctLinker(cp);
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
cp = /** @type {number} */ (input.codePointAt(cursor));
|
|
88
|
-
catAfter = cat(cp, cache);
|
|
89
|
-
|
|
90
|
-
if (catBefore === 10 /* Regional_Indicator */) {
|
|
91
|
-
risCount++;
|
|
92
|
-
} else {
|
|
93
|
-
risCount = 0;
|
|
94
|
-
if (
|
|
95
|
-
catAfter === 14 /* ZWJ */
|
|
96
|
-
&& (catBefore === 3 /* Extend */ || catBefore === 4 /* Extended_Pictographic */)
|
|
97
|
-
) {
|
|
98
|
-
emoji = true;
|
|
99
|
-
|
|
100
|
-
} else if (catAfter === 0 /* Any */ && cp >= 2325) {
|
|
101
|
-
// Note: Put GB9c rule checking here to reduce.
|
|
102
|
-
incb = consonant && linker && (consonant = isIndicConjunctConsonant(cp));
|
|
103
|
-
// It cannot be both a linker and a consonant.
|
|
104
|
-
linker = linker && !consonant;
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
if (isBoundary(catBefore, catAfter, risCount, emoji, incb)) {
|
|
109
|
-
yield {
|
|
110
|
-
segment: input.slice(index, cursor),
|
|
111
|
-
index,
|
|
112
|
-
input,
|
|
113
|
-
_hd,
|
|
114
|
-
_catBegin,
|
|
115
|
-
_catEnd: catBefore,
|
|
116
|
-
};
|
|
117
|
-
|
|
118
|
-
// flush
|
|
119
|
-
emoji = false;
|
|
120
|
-
incb = false;
|
|
121
|
-
index = cursor;
|
|
122
|
-
_catBegin = catAfter;
|
|
123
|
-
_hd = cp;
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
cursor += cp <= BMP_MAX ? 1 : 2;
|
|
127
|
-
catBefore = catAfter;
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
if (index < len) {
|
|
131
|
-
yield {
|
|
132
|
-
segment: input.slice(index),
|
|
133
|
-
index,
|
|
134
|
-
input,
|
|
135
|
-
_hd,
|
|
136
|
-
_catBegin,
|
|
137
|
-
_catEnd: catBefore,
|
|
138
|
-
};
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
/**
|
|
143
|
-
* Split given text into extended grapheme clusters.
|
|
144
|
-
*
|
|
145
|
-
* @param {string} text
|
|
146
|
-
* @return {IterableIterator<string>} iterator for grapheme clusters
|
|
147
|
-
*
|
|
148
|
-
* @see {@link graphemeSegments} if you need extra information.
|
|
149
|
-
*
|
|
150
|
-
* @example
|
|
151
|
-
* [...splitGraphemes('abc')] // => ['a', 'b', 'c']
|
|
152
|
-
*/
|
|
153
|
-
function* splitGraphemes(text) {
|
|
154
|
-
for (let s of graphemeSegments(text)) yield s.segment;
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
/**
|
|
158
|
-
* Precompute a fast lookup table for BMP code points (0..0xFFFF)
|
|
159
|
-
* This table maps each code point to its Grapheme_Cluster_Break category.
|
|
160
|
-
* It is generated once at module load time using the grapheme_ranges data.
|
|
161
|
-
* The table is a Uint8Array of length 0x10000 (64KB), which is acceptable in memory.
|
|
162
|
-
* For code points >= 0x10000 we fall back to binary search.
|
|
163
|
-
*/
|
|
164
|
-
let bmpLookup = new Uint8Array(BMP_MAX + 1);
|
|
165
|
-
let bmpCursor = (() => {
|
|
166
|
-
let cursor = 0;
|
|
167
|
-
let cp = 0;
|
|
168
|
-
while (cp <= BMP_MAX) {
|
|
169
|
-
let range = grapheme_ranges[cursor++];
|
|
170
|
-
for (cp = range[0]; cp <= range[1]; cp++) {
|
|
171
|
-
bmpLookup[cp] = range[2];
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
return cursor;
|
|
175
|
-
})();
|
|
176
|
-
|
|
177
|
-
/**
|
|
178
|
-
* `Grapheme_Cluster_Break` property value of a given codepoint
|
|
179
|
-
*
|
|
180
|
-
* @see https://www.unicode.org/reports/tr29/tr29-43.html#Default_Grapheme_Cluster_Table
|
|
181
|
-
*
|
|
182
|
-
* @param {number} cp
|
|
183
|
-
* @param {import('./_grapheme_data.js').GraphemeCategoryRange} cache
|
|
184
|
-
* @return {GraphemeCategoryNum}
|
|
185
|
-
*/
|
|
186
|
-
function cat(cp, cache) {
|
|
187
|
-
// Fast lookup for BMP (0x0000..0xFFFF) using precomputed table
|
|
188
|
-
if (cp <= BMP_MAX) {
|
|
189
|
-
return /** @type {GraphemeCategoryNum} */ (bmpLookup[cp]);
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
// Use cached result
|
|
193
|
-
if (cp >= cache[0] && cp <= cache[1]) {
|
|
194
|
-
return cache[2];
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
// Binary search, starting from bmpCursor
|
|
198
|
-
let index = findUnicodeRangeIndex(cp, grapheme_ranges, bmpCursor);
|
|
199
|
-
if (index < 0) {
|
|
200
|
-
return 0;
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
const range = grapheme_ranges[index];
|
|
204
|
-
cache[0] = range[0];
|
|
205
|
-
cache[1] = range[1];
|
|
206
|
-
return (cache[2] = range[2]);
|
|
207
|
-
}
|
|
208
|
-
/**
|
|
209
|
-
* @param {number} cp
|
|
210
|
-
* @return {boolean}
|
|
211
|
-
*/
|
|
212
|
-
function isIndicConjunctConsonant(cp) {
|
|
213
|
-
return findUnicodeRangeIndex(cp, consonant_ranges) >= 0;
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
/**
|
|
217
|
-
* @param {number} cp
|
|
218
|
-
* @return {boolean}
|
|
219
|
-
*/
|
|
220
|
-
function isIndicConjunctLinker(cp) {
|
|
221
|
-
return (
|
|
222
|
-
cp === 2381 /* 0x094D */ ||
|
|
223
|
-
cp === 2509 /* 0x09CD */ ||
|
|
224
|
-
cp === 2765 /* 0x0ACD */ ||
|
|
225
|
-
cp === 2893 /* 0x0B4D */ ||
|
|
226
|
-
cp === 3149 /* 0x0C4D */ ||
|
|
227
|
-
cp === 3405 /* 0x0D4D */
|
|
228
|
-
);
|
|
229
|
-
}
|
|
230
|
-
|
|
231
|
-
/**
|
|
232
|
-
* @param {GraphemeCategoryNum} catBefore
|
|
233
|
-
* @param {GraphemeCategoryNum} catAfter
|
|
234
|
-
* @param {number} risCount Regional_Indicator state
|
|
235
|
-
* @param {boolean} emoji Extended_Pictographic state
|
|
236
|
-
* @param {boolean} incb Indic_Conjunct_Break state
|
|
237
|
-
* @return {boolean}
|
|
238
|
-
*
|
|
239
|
-
* @see https://www.unicode.org/reports/tr29/tr29-43.html#Grapheme_Cluster_Boundary_Rules
|
|
240
|
-
*/
|
|
241
|
-
function isBoundary(catBefore, catAfter, risCount, emoji, incb) {
|
|
242
|
-
// GB3
|
|
243
|
-
if (catBefore === 1 && catAfter === 6) {
|
|
244
|
-
return false;
|
|
245
|
-
}
|
|
246
|
-
|
|
247
|
-
// GB4
|
|
248
|
-
if (catBefore === 1 || catBefore === 2 || catBefore === 6) {
|
|
249
|
-
return true;
|
|
250
|
-
}
|
|
251
|
-
|
|
252
|
-
// GB5
|
|
253
|
-
if (catAfter === 1 || catAfter === 2 || catAfter === 6) {
|
|
254
|
-
return true;
|
|
255
|
-
}
|
|
256
|
-
|
|
257
|
-
// Most common cases - GB9, GB9a extend rules
|
|
258
|
-
if (catAfter === 3 || catAfter === 14 || catAfter === 11) {
|
|
259
|
-
return false;
|
|
260
|
-
}
|
|
261
|
-
|
|
262
|
-
// GB6 - L x (L | V | LV | LVT)
|
|
263
|
-
if (catBefore === 5) {
|
|
264
|
-
return !(catAfter === 5 || catAfter === 7 || catAfter === 8 || catAfter === 13);
|
|
265
|
-
}
|
|
266
|
-
|
|
267
|
-
// GB7 - (LV | V) x (V | T)
|
|
268
|
-
if (
|
|
269
|
-
(catBefore === 7 || catBefore === 13) &&
|
|
270
|
-
(catAfter === 13 || catAfter === 12)
|
|
271
|
-
) {
|
|
272
|
-
return false;
|
|
273
|
-
}
|
|
274
|
-
|
|
275
|
-
// GB8 - (LVT | T) x T
|
|
276
|
-
if (
|
|
277
|
-
(catBefore === 8 || catBefore === 12) &&
|
|
278
|
-
catAfter === 12
|
|
279
|
-
) {
|
|
280
|
-
return false;
|
|
281
|
-
}
|
|
282
|
-
|
|
283
|
-
// GB9b
|
|
284
|
-
if (catBefore === 9) {
|
|
285
|
-
return false;
|
|
286
|
-
}
|
|
287
|
-
|
|
288
|
-
// GB9c
|
|
289
|
-
if (catAfter === 0 && incb) {
|
|
290
|
-
return false;
|
|
291
|
-
}
|
|
292
|
-
|
|
293
|
-
// GB11
|
|
294
|
-
if (catBefore === 14 && catAfter === 4) {
|
|
295
|
-
return !emoji;
|
|
296
|
-
}
|
|
297
|
-
|
|
298
|
-
// GB12, GB13
|
|
299
|
-
if (catBefore === 10 && catAfter === 10) {
|
|
300
|
-
return risCount % 2 === 0;
|
|
301
|
-
}
|
|
302
|
-
|
|
303
|
-
// GB999
|
|
304
|
-
return true;
|
|
305
|
-
}
|
|
306
|
-
|
|
307
|
-
export { graphemeSegments, splitGraphemes };
|