@wix/site-service-editor-context 1.0.1 → 1.0.3
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/cjs/build/definition/index.js.map +1 -1
- package/cjs/build/implementations/editorContextService.js.map +1 -1
- package/cjs/build/service.js.map +1 -1
- package/cjs/package.json +1 -1
- package/definition/package.json +1 -1
- package/dist/definition/index.js.map +1 -1
- package/dist/implementations/editorContextService.js.map +1 -1
- package/implementations/package.json +1 -1
- package/package.json +17 -17
- package/src/definition/index.ts +6 -6
- package/src/implementations/editorContextService.ts +19 -19
- package/types/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/definition/index.ts"],"names":[],"mappings":";;;AAAA,oEAAyD;AAiB5C,QAAA,uBAAuB,GAAG,IAAA,oCAAa,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/definition/index.ts"],"names":[],"mappings":";;;AAAA,oEAAyD;AAiB5C,QAAA,uBAAuB,GAAG,IAAA,oCAAa,EACnD,kCAAkC,CAClC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"editorContextService.js","sourceRoot":"","sources":["../../../src/implementations/editorContextService.ts"],"names":[],"mappings":";;;AAAA,oEAA4D;AAE5D,6EAA0F;AAE1F,8CAAuD;AAE1C,QAAA,oBAAoB,GAAG,IAAA,uCAAgB,
|
|
1
|
+
{"version":3,"file":"editorContextService.js","sourceRoot":"","sources":["../../../src/implementations/editorContextService.ts"],"names":[],"mappings":";;;AAAA,oEAA4D;AAE5D,6EAA0F;AAE1F,8CAAuD;AAE1C,QAAA,oBAAoB,GAAG,IAAA,uCAAgB,EACnD,oCAAuB,EACvB,CAAC,EAAE,MAAM,EAAE,UAAU,EAAmD,EAAyB,EAAE;IAClG,MAAM,EAAE,MAAM,EAAE,GAAG,UAAU,CAAC,kCAAwB,CAAC,CAAA;IACvD,MAAM,UAAU,GAAG,MAAM,CAAC,UAAU,IAAI,QAAQ,CAAA;IAChD,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,CAAC,WAAW,IAAI,KAAK,CAAC,CAAA;IAExD,OAAO;QACN,IAAI,UAAU;YACb,OAAO,UAAU,CAAA;QAClB,CAAC;QACD,IAAI,WAAW;YACd,OAAO,YAAY,CAAC,GAAG,EAAE,CAAA;QAC1B,CAAC;QACD,aAAa,CAAC,MAA4C;YACzD,IAAI,MAAM,CAAC,WAAW,KAAK,SAAS,EAAE,CAAC;gBACtC,YAAY,CAAC,GAAG,CAAC,MAAM,CAAC,WAAW,CAAC,CAAA;YACrC,CAAC;QACF,CAAC;KACD,CAAA;AACF,CAAC,CACD,CAAA"}
|
package/cjs/build/service.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service.js","sourceRoot":"","sources":["../../src/service.ts"],"names":[],"mappings":";;;AAAA,6CAAsD;AACtD,iFAA6E;AAEhE,QAAA,UAAU,GAAG,oCAAuB,CAAA;
|
|
1
|
+
{"version":3,"file":"service.js","sourceRoot":"","sources":["../../src/service.ts"],"names":[],"mappings":";;;AAAA,6CAAsD;AACtD,iFAA6E;AAEhE,QAAA,UAAU,GAAG,oCAAuB,CAAA;kBAClC,2CAAoB"}
|
package/cjs/package.json
CHANGED
package/definition/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/definition/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAA;AAiBzD,MAAM,CAAC,MAAM,uBAAuB,GAAG,aAAa,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/definition/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAA;AAiBzD,MAAM,CAAC,MAAM,uBAAuB,GAAG,aAAa,CACnD,kCAAkC,CAClC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"editorContextService.js","sourceRoot":"","sources":["../../src/implementations/editorContextService.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAA;AAE5D,OAAO,EAAE,wBAAwB,EAAE,MAAM,iDAAiD,CAAA;AAE1F,OAAO,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAA;AAEvD,MAAM,CAAC,MAAM,oBAAoB,GAAG,gBAAgB,
|
|
1
|
+
{"version":3,"file":"editorContextService.js","sourceRoot":"","sources":["../../src/implementations/editorContextService.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAA;AAE5D,OAAO,EAAE,wBAAwB,EAAE,MAAM,iDAAiD,CAAA;AAE1F,OAAO,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAA;AAEvD,MAAM,CAAC,MAAM,oBAAoB,GAAG,gBAAgB,CACnD,uBAAuB,EACvB,CAAC,EAAE,MAAM,EAAE,UAAU,EAAmD,EAAyB,EAAE;IAClG,MAAM,EAAE,MAAM,EAAE,GAAG,UAAU,CAAC,wBAAwB,CAAC,CAAA;IACvD,MAAM,UAAU,GAAG,MAAM,CAAC,UAAU,IAAI,QAAQ,CAAA;IAChD,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,CAAC,WAAW,IAAI,KAAK,CAAC,CAAA;IAExD,OAAO;QACN,IAAI,UAAU;YACb,OAAO,UAAU,CAAA;QAClB,CAAC;QACD,IAAI,WAAW;YACd,OAAO,YAAY,CAAC,GAAG,EAAE,CAAA;QAC1B,CAAC;QACD,aAAa,CAAC,MAA4C;YACzD,IAAI,MAAM,CAAC,WAAW,KAAK,SAAS,EAAE,CAAC;gBACtC,YAAY,CAAC,GAAG,CAAC,MAAM,CAAC,WAAW,CAAC,CAAA;YACrC,CAAC;QACF,CAAC;KACD,CAAA;AACF,CAAC,CACD,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wix/site-service-editor-context",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"main": "cjs/build/index.js",
|
|
5
|
-
"module": "dist/index.js",
|
|
6
|
-
"types": "dist/index.d.ts",
|
|
3
|
+
"version": "1.0.3",
|
|
7
4
|
"license": "UNLICENSED",
|
|
8
5
|
"files": [
|
|
9
6
|
"dist",
|
|
@@ -14,6 +11,10 @@
|
|
|
14
11
|
"types",
|
|
15
12
|
"!**/*.tsbuildinfo"
|
|
16
13
|
],
|
|
14
|
+
"sideEffects": false,
|
|
15
|
+
"main": "cjs/build/index.js",
|
|
16
|
+
"module": "dist/index.js",
|
|
17
|
+
"types": "dist/index.d.ts",
|
|
17
18
|
"exports": {
|
|
18
19
|
".": {
|
|
19
20
|
"types": "./dist/index.d.ts",
|
|
@@ -41,13 +42,9 @@
|
|
|
41
42
|
"require": "./cjs/build/service.js"
|
|
42
43
|
}
|
|
43
44
|
},
|
|
44
|
-
"
|
|
45
|
-
"
|
|
46
|
-
"
|
|
47
|
-
},
|
|
48
|
-
"devDependencies": {
|
|
49
|
-
"typescript": "^5.3.3",
|
|
50
|
-
"vitest": "4.1.0"
|
|
45
|
+
"publishConfig": {
|
|
46
|
+
"registry": "https://registry.npmjs.org/",
|
|
47
|
+
"access": "public"
|
|
51
48
|
},
|
|
52
49
|
"scripts": {
|
|
53
50
|
"build": "tsc -b . --force && tsc --project tsconfig.cjs.json",
|
|
@@ -55,12 +52,15 @@
|
|
|
55
52
|
"test": "vitest --run && yarn test-type-check",
|
|
56
53
|
"test-type-check": "echo 'validating typescript in test files' && tsc --project tsconfig.test.json && echo 'Finished validating typescript in test files successfully'"
|
|
57
54
|
},
|
|
58
|
-
"
|
|
59
|
-
|
|
60
|
-
"
|
|
61
|
-
"access": "public"
|
|
55
|
+
"dependencies": {
|
|
56
|
+
"@wix/services-definitions": "^0.1.4",
|
|
57
|
+
"@wix/services-manager": "^0.2.20"
|
|
62
58
|
},
|
|
63
|
-
"
|
|
59
|
+
"devDependencies": {
|
|
60
|
+
"typescript": "~7.0.2",
|
|
61
|
+
"vitest": "4.1.11"
|
|
62
|
+
},
|
|
63
|
+
"publishUnscoped": false,
|
|
64
64
|
"wix": {
|
|
65
65
|
"artifact": {
|
|
66
66
|
"groupId": "com.wixpress.npm",
|
|
@@ -77,5 +77,5 @@
|
|
|
77
77
|
]
|
|
78
78
|
}
|
|
79
79
|
},
|
|
80
|
-
"falconPackageHash": "
|
|
80
|
+
"falconPackageHash": "e8ffeaf0f133d18a0bf8cae72a577bef2d9176d21f3fff270239be73"
|
|
81
81
|
}
|
package/src/definition/index.ts
CHANGED
|
@@ -3,18 +3,18 @@ import type { ServiceDefinition } from '@wix/services-definitions'
|
|
|
3
3
|
import type { EditorName } from '../types'
|
|
4
4
|
|
|
5
5
|
export type IEditorContextServiceConfig = {
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
editorName?: EditorName
|
|
7
|
+
previewMode?: boolean
|
|
8
8
|
}
|
|
9
9
|
|
|
10
10
|
export interface IEditorContextService {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
readonly editorName: EditorName
|
|
12
|
+
readonly previewMode: boolean
|
|
13
|
+
_updateConfig: (config: Partial<IEditorContextServiceConfig>) => void
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
export type IEditorContextDefinition = ServiceDefinition<IEditorContextService, IEditorContextServiceConfig>
|
|
17
17
|
|
|
18
18
|
export const EditorContextDefinition = defineService<IEditorContextService, IEditorContextServiceConfig>(
|
|
19
|
-
|
|
19
|
+
'@wix/site-service-editor-context'
|
|
20
20
|
)
|
|
@@ -5,24 +5,24 @@ import type { IEditorContextService, IEditorContextServiceConfig } from '../defi
|
|
|
5
5
|
import { EditorContextDefinition } from '../definition'
|
|
6
6
|
|
|
7
7
|
export const EditorContextService = implementService(
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
8
|
+
EditorContextDefinition,
|
|
9
|
+
({ config, getService }: ServiceFactoryOpts<IEditorContextServiceConfig>): IEditorContextService => {
|
|
10
|
+
const { signal } = getService(SignalsServiceDefinition)
|
|
11
|
+
const editorName = config.editorName ?? 'Studio'
|
|
12
|
+
const _previewMode = signal(config.previewMode ?? false)
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
14
|
+
return {
|
|
15
|
+
get editorName() {
|
|
16
|
+
return editorName
|
|
17
|
+
},
|
|
18
|
+
get previewMode() {
|
|
19
|
+
return _previewMode.get()
|
|
20
|
+
},
|
|
21
|
+
_updateConfig(config: Partial<IEditorContextServiceConfig>) {
|
|
22
|
+
if (config.previewMode !== undefined) {
|
|
23
|
+
_previewMode.set(config.previewMode)
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
28
|
)
|
package/types/package.json
CHANGED