@lls/typings 24.26.0 → 24.27.0-04d61df0
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/historyProps.d.ts +2 -1
- package/overrides/window.d.ts +4 -0
- package/package.json +1 -1
- package/viewer.ts +40 -0
package/historyProps.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { Page } from '@lls/store'
|
|
2
|
+
import type { OnChangeContext } from '@typings/viewer'
|
|
2
3
|
|
|
3
4
|
export type HistoryItem = {
|
|
4
5
|
template: Page
|
|
@@ -14,7 +15,7 @@ export type LightTouchedIds = Record<string, number>
|
|
|
14
15
|
|
|
15
16
|
export type useViewerHistoryProps = {
|
|
16
17
|
template: Page
|
|
17
|
-
onChange?: (template: Page, context: string) => void
|
|
18
|
+
onChange?: (template: Page, context: OnChangeContext | string) => void
|
|
18
19
|
}
|
|
19
20
|
|
|
20
21
|
export type HistoryProps = {
|
package/overrides/window.d.ts
CHANGED
package/package.json
CHANGED
package/viewer.ts
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { DocJson, Page } from '@lls/store'
|
|
2
|
+
import type { OnChangeContextSource } from '@viewer/constants/lightEditor.ts'
|
|
3
|
+
|
|
4
|
+
type OnChangeContextLightTag = {
|
|
5
|
+
source: OnChangeContextSource.LIGHT_EDITOR_ONCHANGE_TAG_CONTEXT
|
|
6
|
+
contentMd: string // when adding a <b> tag, DOM is not modified, in this case trust given html
|
|
7
|
+
}
|
|
8
|
+
type OnChangeContextExercise = {
|
|
9
|
+
source:
|
|
10
|
+
| OnChangeContextSource.EXERCISE_CONTEXT
|
|
11
|
+
| OnChangeContextSource.EXERCISE_CONTEXT_NEXT
|
|
12
|
+
| OnChangeContextSource.EXERCISE_CONTEXT_SKIP
|
|
13
|
+
| OnChangeContextSource.EXERCISE_CONTEXT_SELECT
|
|
14
|
+
document: Page
|
|
15
|
+
isTask?: boolean
|
|
16
|
+
}
|
|
17
|
+
type OnChangeContextWorkplanCard = {
|
|
18
|
+
source: OnChangeContextSource.WORKPLAN_CONTEXT
|
|
19
|
+
document: Page
|
|
20
|
+
workplanCardOption: { uuid: DocJson['uuid']; time: string }
|
|
21
|
+
}
|
|
22
|
+
type OnChangeContextWorkplanDuplicateTaskSource = {
|
|
23
|
+
source: OnChangeContextSource.WORKPLAN_CONTEXT_DUPLICATE_TASK_SOURCE
|
|
24
|
+
}
|
|
25
|
+
type OnChangeContextDefault = {
|
|
26
|
+
source: Exclude<
|
|
27
|
+
OnChangeContextSource,
|
|
28
|
+
| OnChangeContextLightTag['source']
|
|
29
|
+
| OnChangeContextWorkplanCard['source']
|
|
30
|
+
| OnChangeContextWorkplanDuplicateTaskSource['source']
|
|
31
|
+
>
|
|
32
|
+
contentMd?: string
|
|
33
|
+
}
|
|
34
|
+
export type OnChangeContext = (
|
|
35
|
+
| OnChangeContextLightTag
|
|
36
|
+
| OnChangeContextExercise
|
|
37
|
+
| OnChangeContextWorkplanCard
|
|
38
|
+
| OnChangeContextWorkplanDuplicateTaskSource
|
|
39
|
+
| OnChangeContextDefault
|
|
40
|
+
) & { buildFromHtml?: boolean; contentMd?: string }
|