Skip to content

Commit 5c2ee28

Browse files
authored
chore: use short nanoid (#1668)
1 parent 52ef575 commit 5c2ee28

File tree

6 files changed

+12
-8
lines changed

6 files changed

+12
-8
lines changed

Diff for: packages/components/src/image-block/view/component.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import type { Component } from 'atomico'
22
import { c, html, useEffect, useRef, useState } from 'atomico'
3-
import { nanoid } from 'nanoid'
3+
import { customAlphabet } from 'nanoid'
44
import clsx from 'clsx'
55
import type { ImageBlockConfig } from '../config'
66
import { IMAGE_DATA_TYPE } from '../schema'
@@ -21,6 +21,8 @@ export type ImageComponentProps = Attrs & {
2121

2222
let timer: number = 0
2323

24+
const nanoid = customAlphabet('abcdefg', 8)
25+
2426
export const imageComponent: Component<ImageComponentProps> = ({
2527
src = '',
2628
caption = '',

Diff for: packages/components/src/image-inline/component.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { c, html, useRef, useState } from 'atomico'
22
import type { Component } from 'atomico'
3-
import { nanoid } from 'nanoid'
3+
import { customAlphabet } from 'nanoid'
44
import clsx from 'clsx'
55
import type { InlineImageConfig } from './config'
66

@@ -16,6 +16,8 @@ export type InlineImageComponentProps = Attrs & {
1616
config: InlineImageConfig
1717
}
1818

19+
const nanoid = customAlphabet('abcdefg', 8)
20+
1921
export const inlineImageComponent: Component<InlineImageComponentProps> = ({
2022
src = '',
2123
selected = false,

Diff for: packages/crepe/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@
7171
"clsx": "^2.0.0",
7272
"codemirror": "^6.0.1",
7373
"katex": "^0.16.0",
74-
"nanoid": "^5.0.0",
74+
"nanoid": "^5.0.9",
7575
"remark-math": "^6.0.0",
7676
"tslib": "^2.8.1",
7777
"unist-util-visit": "^5.0.0"

Diff for: packages/plugins/plugin-diagram/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
"@milkdown/exception": "workspace:*",
5252
"@milkdown/utils": "workspace:*",
5353
"mermaid": "^10.9.0",
54-
"nanoid": "^5.0.0",
54+
"nanoid": "^5.0.9",
5555
"tslib": "^2.8.1",
5656
"unist-util-visit": "^5.0.0"
5757
},

Diff for: packages/utils/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
},
4444
"dependencies": {
4545
"@milkdown/exception": "workspace:*",
46-
"nanoid": "^5.0.0",
46+
"nanoid": "^5.0.9",
4747
"tslib": "^2.8.1"
4848
},
4949
"devDependencies": {

Diff for: pnpm-lock.yaml

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)