@wix/site-service-editor-context 1.0.1 → 1.0.2

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.
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/definition/index.ts"],"names":[],"mappings":";;;AAAA,oEAAyD;AAiB5C,QAAA,uBAAuB,GAAG,IAAA,oCAAa,EAChD,kCAAkC,CACrC,CAAA"}
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,EAChD,oCAAuB,EACvB,CAAC,EAAE,MAAM,EAAE,UAAU,EAAmD,EAAyB,EAAE;IAC/F,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;QACH,IAAI,UAAU;YACV,OAAO,UAAU,CAAA;QACrB,CAAC;QACD,IAAI,WAAW;YACX,OAAO,YAAY,CAAC,GAAG,EAAE,CAAA;QAC7B,CAAC;QACD,aAAa,CAAC,MAA4C;YACtD,IAAI,MAAM,CAAC,WAAW,KAAK,SAAS,EAAE,CAAC;gBACnC,YAAY,CAAC,GAAG,CAAC,MAAM,CAAC,WAAW,CAAC,CAAA;YACxC,CAAC;QACL,CAAC;KACJ,CAAA;AACL,CAAC,CACJ,CAAA"}
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/package.json CHANGED
@@ -1,3 +1,3 @@
1
1
  {
2
- "type": "commonjs"
2
+ "type": "commonjs"
3
3
  }
@@ -1,3 +1,3 @@
1
1
  {
2
- "main": "../cjs/build/definition/index.js"
2
+ "main": "../cjs/build/definition/index.js"
3
3
  }
@@ -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,CAChD,kCAAkC,CACrC,CAAA"}
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,CAChD,uBAAuB,EACvB,CAAC,EAAE,MAAM,EAAE,UAAU,EAAmD,EAAyB,EAAE;IAC/F,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;QACH,IAAI,UAAU;YACV,OAAO,UAAU,CAAA;QACrB,CAAC;QACD,IAAI,WAAW;YACX,OAAO,YAAY,CAAC,GAAG,EAAE,CAAA;QAC7B,CAAC;QACD,aAAa,CAAC,MAA4C;YACtD,IAAI,MAAM,CAAC,WAAW,KAAK,SAAS,EAAE,CAAC;gBACnC,YAAY,CAAC,GAAG,CAAC,MAAM,CAAC,WAAW,CAAC,CAAA;YACxC,CAAC;QACL,CAAC;KACJ,CAAA;AACL,CAAC,CACJ,CAAA"}
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"}
@@ -1,3 +1,3 @@
1
1
  {
2
- "main": "../cjs/build/implementations/index.js"
2
+ "main": "../cjs/build/implementations/index.js"
3
3
  }
package/package.json CHANGED
@@ -1,9 +1,6 @@
1
1
  {
2
2
  "name": "@wix/site-service-editor-context",
3
- "version": "1.0.1",
4
- "main": "cjs/build/index.js",
5
- "module": "dist/index.js",
6
- "types": "dist/index.d.ts",
3
+ "version": "1.0.2",
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,6 +42,16 @@
41
42
  "require": "./cjs/build/service.js"
42
43
  }
43
44
  },
45
+ "publishConfig": {
46
+ "registry": "https://registry.npmjs.org/",
47
+ "access": "public"
48
+ },
49
+ "scripts": {
50
+ "build": "tsc -b . --force && tsc --project tsconfig.cjs.json",
51
+ "lint": "yarn run -T lint:package $npm_package_name",
52
+ "test": "vitest --run && yarn test-type-check",
53
+ "test-type-check": "echo 'validating typescript in test files' && tsc --project tsconfig.test.json && echo 'Finished validating typescript in test files successfully'"
54
+ },
44
55
  "dependencies": {
45
56
  "@wix/services-definitions": "^0.1.4",
46
57
  "@wix/services-manager": "^0.2.20"
@@ -49,18 +60,7 @@
49
60
  "typescript": "^5.3.3",
50
61
  "vitest": "4.1.0"
51
62
  },
52
- "scripts": {
53
- "build": "tsc -b . --force && tsc --project tsconfig.cjs.json",
54
- "lint": "yarn run -T lint:package $npm_package_name",
55
- "test": "vitest --run && yarn test-type-check",
56
- "test-type-check": "echo 'validating typescript in test files' && tsc --project tsconfig.test.json && echo 'Finished validating typescript in test files successfully'"
57
- },
58
63
  "publishUnscoped": false,
59
- "publishConfig": {
60
- "registry": "https://registry.npmjs.org/",
61
- "access": "public"
62
- },
63
- "sideEffects": 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": "5dd230f43c09bd699bcacd65b7897eea5d9c7251d9d8817e58090df4"
80
+ "falconPackageHash": "41d44dbae409167c131c5c247b3a6ff49c12a5e7eaa16786ac8a5289"
81
81
  }
@@ -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
- editorName?: EditorName
7
- previewMode?: boolean
6
+ editorName?: EditorName
7
+ previewMode?: boolean
8
8
  }
9
9
 
10
10
  export interface IEditorContextService {
11
- readonly editorName: EditorName
12
- readonly previewMode: boolean
13
- _updateConfig: (config: Partial<IEditorContextServiceConfig>) => void
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
- '@wix/site-service-editor-context'
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
- 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)
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
- 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
- }
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
  )
@@ -1,3 +1,3 @@
1
1
  {
2
- "main": "../cjs/build/types/index.js"
2
+ "main": "../cjs/build/types/index.js"
3
3
  }