dockview-vue 1.14.0 → 1.14.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.
package/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  <div align="center">
2
2
  <h1>dockview</h1>
3
3
 
4
- <p>Zero dependency layout manager supporting tabs, groups, grids and splitviews with ReactJS support written in TypeScript</p>
4
+ <p>Zero dependency layout manager supporting tabs, groups, grids and splitviews. Supports React, Vue and Vanilla TypeScript</p>
5
5
 
6
6
  </div>
7
7
 
@@ -16,6 +16,8 @@
16
16
 
17
17
  ##
18
18
 
19
+ ![](packages/docs/static/img/splashscreen.gif)
20
+
19
21
  Please see the website: https://dockview.dev
20
22
 
21
23
  ## Features
@@ -34,23 +36,3 @@ Please see the website: https://dockview.dev
34
36
  - Security at mind - verifed publishing and builds through GitHub Actions
35
37
 
36
38
  Want to verify our builds? Go [here](https://www.npmjs.com/package/dockview#Provenance).
37
-
38
- ## Quick start
39
-
40
- Dockview has a peer dependency on `react >= 16.8.0` and `react-dom >= 16.8.0`. You can install dockview from [npm](https://www.npmjs.com/package/dockview).
41
-
42
- ```
43
- npm install --save dockview
44
- ```
45
-
46
- Within your project you must import or reference the stylesheet at `dockview/dist/styles/dockview.css` and attach a theme.
47
-
48
- ```css
49
- @import '~dockview/dist/styles/dockview.css';
50
- ```
51
-
52
- You should also attach a dockview theme to an element containing your components. For example:
53
-
54
- ```html
55
- <body classname="dockview-theme-dark"></body>
56
- ```
@@ -199,70 +199,74 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
199
199
  });
200
200
  vue.onMounted(() => {
201
201
  if (!el.value) {
202
- throw new Error("element is not mounted");
202
+ throw new Error("dockview-vue: element is not mounted");
203
+ }
204
+ const inst = vue.getCurrentInstance();
205
+ if (!inst) {
206
+ throw new Error("dockview-vue: getCurrentInstance() returned null");
203
207
  }
204
208
  const frameworkOptions = {
205
209
  parentElement: el.value,
206
210
  createComponent(options) {
207
211
  const component = findComponent(
208
- vue.getCurrentInstance(),
212
+ inst,
209
213
  options.name
210
214
  );
211
- return new VueRenderer(component, vue.getCurrentInstance());
215
+ return new VueRenderer(component, inst);
212
216
  },
213
217
  createTabComponent(options) {
214
- let component = findComponent(vue.getCurrentInstance(), options.name);
218
+ let component = findComponent(inst, options.name);
215
219
  if (!component && props.defaultTabComponent) {
216
220
  component = findComponent(
217
- vue.getCurrentInstance(),
221
+ inst,
218
222
  props.defaultTabComponent
219
223
  );
220
224
  }
221
225
  if (component) {
222
- return new VueRenderer(component, vue.getCurrentInstance());
226
+ return new VueRenderer(component, inst);
223
227
  }
224
228
  return void 0;
225
229
  },
226
230
  createWatermarkComponent: props.watermarkComponent ? () => {
227
231
  const component = findComponent(
228
- vue.getCurrentInstance(),
232
+ inst,
229
233
  props.watermarkComponent
230
234
  );
231
235
  return new VueWatermarkRenderer(
232
236
  component,
233
- vue.getCurrentInstance()
237
+ inst
234
238
  );
235
239
  } : void 0,
236
240
  createLeftHeaderActionComponent: props.leftHeaderActionsComponent ? (group) => {
237
241
  const component = findComponent(
238
- vue.getCurrentInstance(),
242
+ inst,
239
243
  props.leftHeaderActionsComponent
240
244
  );
241
245
  return new VueHeaderActionsRenderer(
242
246
  component,
243
- vue.getCurrentInstance(),
247
+ inst,
244
248
  group
245
249
  );
246
250
  } : void 0,
247
251
  createPrefixHeaderActionComponent: props.prefixHeaderActionsComponent ? (group) => {
248
252
  const component = findComponent(
249
- vue.getCurrentInstance(),
253
+ inst,
250
254
  props.prefixHeaderActionsComponent
251
255
  );
252
256
  return new VueHeaderActionsRenderer(
253
257
  component,
254
- vue.getCurrentInstance(),
258
+ inst,
255
259
  group
256
260
  );
257
261
  } : void 0,
258
262
  createRightHeaderActionComponent: props.rightHeaderActionsComponent ? (group) => {
259
263
  const component = findComponent(
260
- vue.getCurrentInstance(),
264
+ inst,
261
265
  props.rightHeaderActionsComponent
262
266
  );
263
267
  return new VueHeaderActionsRenderer(
264
268
  component,
265
- vue.getCurrentInstance(),
269
+ inst,
266
270
  group
267
271
  );
268
272
  } : void 0
@@ -198,70 +198,74 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
198
198
  });
199
199
  onMounted(() => {
200
200
  if (!el.value) {
201
- throw new Error("element is not mounted");
201
+ throw new Error("dockview-vue: element is not mounted");
202
+ }
203
+ const inst = getCurrentInstance();
204
+ if (!inst) {
205
+ throw new Error("dockview-vue: getCurrentInstance() returned null");
202
206
  }
203
207
  const frameworkOptions = {
204
208
  parentElement: el.value,
205
209
  createComponent(options) {
206
210
  const component = findComponent(
207
- getCurrentInstance(),
211
+ inst,
208
212
  options.name
209
213
  );
210
- return new VueRenderer(component, getCurrentInstance());
214
+ return new VueRenderer(component, inst);
211
215
  },
212
216
  createTabComponent(options) {
213
- let component = findComponent(getCurrentInstance(), options.name);
217
+ let component = findComponent(inst, options.name);
214
218
  if (!component && props.defaultTabComponent) {
215
219
  component = findComponent(
216
- getCurrentInstance(),
220
+ inst,
217
221
  props.defaultTabComponent
218
222
  );
219
223
  }
220
224
  if (component) {
221
- return new VueRenderer(component, getCurrentInstance());
225
+ return new VueRenderer(component, inst);
222
226
  }
223
227
  return void 0;
224
228
  },
225
229
  createWatermarkComponent: props.watermarkComponent ? () => {
226
230
  const component = findComponent(
227
- getCurrentInstance(),
231
+ inst,
228
232
  props.watermarkComponent
229
233
  );
230
234
  return new VueWatermarkRenderer(
231
235
  component,
232
- getCurrentInstance()
236
+ inst
233
237
  );
234
238
  } : void 0,
235
239
  createLeftHeaderActionComponent: props.leftHeaderActionsComponent ? (group) => {
236
240
  const component = findComponent(
237
- getCurrentInstance(),
241
+ inst,
238
242
  props.leftHeaderActionsComponent
239
243
  );
240
244
  return new VueHeaderActionsRenderer(
241
245
  component,
242
- getCurrentInstance(),
246
+ inst,
243
247
  group
244
248
  );
245
249
  } : void 0,
246
250
  createPrefixHeaderActionComponent: props.prefixHeaderActionsComponent ? (group) => {
247
251
  const component = findComponent(
248
- getCurrentInstance(),
252
+ inst,
249
253
  props.prefixHeaderActionsComponent
250
254
  );
251
255
  return new VueHeaderActionsRenderer(
252
256
  component,
253
- getCurrentInstance(),
257
+ inst,
254
258
  group
255
259
  );
256
260
  } : void 0,
257
261
  createRightHeaderActionComponent: props.rightHeaderActionsComponent ? (group) => {
258
262
  const component = findComponent(
259
- getCurrentInstance(),
263
+ inst,
260
264
  props.rightHeaderActionsComponent
261
265
  );
262
266
  return new VueHeaderActionsRenderer(
263
267
  component,
264
- getCurrentInstance(),
268
+ inst,
265
269
  group
266
270
  );
267
271
  } : void 0
@@ -199,70 +199,74 @@ var __publicField = (obj, key, value) => {
199
199
  });
200
200
  vue.onMounted(() => {
201
201
  if (!el.value) {
202
- throw new Error("element is not mounted");
202
+ throw new Error("dockview-vue: element is not mounted");
203
+ }
204
+ const inst = vue.getCurrentInstance();
205
+ if (!inst) {
206
+ throw new Error("dockview-vue: getCurrentInstance() returned null");
203
207
  }
204
208
  const frameworkOptions = {
205
209
  parentElement: el.value,
206
210
  createComponent(options) {
207
211
  const component = findComponent(
208
- vue.getCurrentInstance(),
212
+ inst,
209
213
  options.name
210
214
  );
211
- return new VueRenderer(component, vue.getCurrentInstance());
215
+ return new VueRenderer(component, inst);
212
216
  },
213
217
  createTabComponent(options) {
214
- let component = findComponent(vue.getCurrentInstance(), options.name);
218
+ let component = findComponent(inst, options.name);
215
219
  if (!component && props.defaultTabComponent) {
216
220
  component = findComponent(
217
- vue.getCurrentInstance(),
221
+ inst,
218
222
  props.defaultTabComponent
219
223
  );
220
224
  }
221
225
  if (component) {
222
- return new VueRenderer(component, vue.getCurrentInstance());
226
+ return new VueRenderer(component, inst);
223
227
  }
224
228
  return void 0;
225
229
  },
226
230
  createWatermarkComponent: props.watermarkComponent ? () => {
227
231
  const component = findComponent(
228
- vue.getCurrentInstance(),
232
+ inst,
229
233
  props.watermarkComponent
230
234
  );
231
235
  return new VueWatermarkRenderer(
232
236
  component,
233
- vue.getCurrentInstance()
237
+ inst
234
238
  );
235
239
  } : void 0,
236
240
  createLeftHeaderActionComponent: props.leftHeaderActionsComponent ? (group) => {
237
241
  const component = findComponent(
238
- vue.getCurrentInstance(),
242
+ inst,
239
243
  props.leftHeaderActionsComponent
240
244
  );
241
245
  return new VueHeaderActionsRenderer(
242
246
  component,
243
- vue.getCurrentInstance(),
247
+ inst,
244
248
  group
245
249
  );
246
250
  } : void 0,
247
251
  createPrefixHeaderActionComponent: props.prefixHeaderActionsComponent ? (group) => {
248
252
  const component = findComponent(
249
- vue.getCurrentInstance(),
253
+ inst,
250
254
  props.prefixHeaderActionsComponent
251
255
  );
252
256
  return new VueHeaderActionsRenderer(
253
257
  component,
254
- vue.getCurrentInstance(),
258
+ inst,
255
259
  group
256
260
  );
257
261
  } : void 0,
258
262
  createRightHeaderActionComponent: props.rightHeaderActionsComponent ? (group) => {
259
263
  const component = findComponent(
260
- vue.getCurrentInstance(),
264
+ inst,
261
265
  props.rightHeaderActionsComponent
262
266
  );
263
267
  return new VueHeaderActionsRenderer(
264
268
  component,
265
- vue.getCurrentInstance(),
269
+ inst,
266
270
  group
267
271
  );
268
272
  } : void 0
@@ -438,16 +438,16 @@
438
438
  .dv-dockview .dv-overlay-render-container {
439
439
  position: relative;
440
440
  }
441
- .dv-dockview .split-view-container.horizontal > .view-container > .view:not(:last-child) {
441
+ .dv-dockview .split-view-container.horizontal > .view-container > .view:not(:last-child) .groupview {
442
442
  border-right: var(--dv-group-gap-size) solid transparent;
443
443
  }
444
- .dv-dockview .split-view-container.horizontal > .view-container > .view:not(:first-child) {
444
+ .dv-dockview .split-view-container.horizontal > .view-container > .view:not(:first-child) .groupview {
445
445
  border-left: var(--dv-group-gap-size) solid transparent;
446
446
  }
447
- .dv-dockview .split-view-container.vertical > .view-container > .view:not(:last-child) {
447
+ .dv-dockview .split-view-container.vertical > .view-container > .view:not(:last-child) .groupview {
448
448
  border-bottom: var(--dv-group-gap-size) solid transparent;
449
449
  }
450
- .dv-dockview .split-view-container.vertical > .view-container > .view:not(:first-child) {
450
+ .dv-dockview .split-view-container.vertical > .view-container > .view:not(:first-child) .groupview {
451
451
  border-top: var(--dv-group-gap-size) solid transparent;
452
452
  }
453
453
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dockview-vue",
3
- "version": "1.14.0",
3
+ "version": "1.14.2",
4
4
  "description": "Zero dependency layout manager supporting tabs, grids and splitviews",
5
5
  "keywords": [
6
6
  "splitview",
@@ -52,6 +52,6 @@
52
52
  "test:cov": "cross-env ../../node_modules/.bin/jest --selectProjects dockview-vue --coverage"
53
53
  },
54
54
  "dependencies": {
55
- "dockview-core": "^1.14.0"
55
+ "dockview-core": "^1.14.2"
56
56
  }
57
57
  }