@plurid/plurid-react 0.0.0-31 → 0.0.0-33

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.
Files changed (61) hide show
  1. package/distribution/components/links/Link/components/Preview/index.d.ts +10 -1
  2. package/distribution/components/links/Link/index.d.ts +19 -1
  3. package/distribution/components/planes/ExternalPlane/index.d.ts +7 -1
  4. package/distribution/components/planes/IframePlane/index.d.ts +7 -1
  5. package/distribution/components/structural/Plane/components/PlaneBridge/index.d.ts +6 -1
  6. package/distribution/components/structural/Plane/components/PlaneControls/components/SearchItem/index.d.ts +7 -1
  7. package/distribution/components/structural/Plane/components/PlaneControls/components/SearchList/index.d.ts +6 -1
  8. package/distribution/components/structural/Plane/components/PlaneControls/index.d.ts +12 -1
  9. package/distribution/components/structural/Plane/components/PlaneDebugger/index.d.ts +5 -1
  10. package/distribution/components/structural/Plane/index.d.ts +10 -1
  11. package/distribution/components/structural/Root/index.d.ts +6 -1
  12. package/distribution/components/structural/Roots/index.d.ts +5 -1
  13. package/distribution/components/structural/Space/components/SpaceDebugger/index.d.ts +5 -1
  14. package/distribution/components/structural/Space/index.d.ts +5 -1
  15. package/distribution/components/utilities/ApplicationConfigurator/index.d.ts +8 -1
  16. package/distribution/components/utilities/NotFound/index.d.ts +5 -1
  17. package/distribution/components/utilities/Origin/index.d.ts +5 -1
  18. package/distribution/components/utilities/PlaneConfigurator/index.d.ts +8 -1
  19. package/distribution/components/utilities/Toolbar/General/components/Drawer/index.d.ts +9 -1
  20. package/distribution/components/utilities/Toolbar/General/components/MenuMore/components/Global/index.d.ts +5 -1
  21. package/distribution/components/utilities/Toolbar/General/components/MenuMore/components/Shortcuts/index.d.ts +5 -1
  22. package/distribution/components/utilities/Toolbar/General/components/MenuMore/components/Space/index.d.ts +5 -1
  23. package/distribution/components/utilities/Toolbar/General/components/MenuMore/components/Technical/index.d.ts +5 -1
  24. package/distribution/components/utilities/Toolbar/General/components/MenuMore/components/Toolbar/index.d.ts +5 -1
  25. package/distribution/components/utilities/Toolbar/General/components/MenuMore/components/Transform/index.d.ts +5 -1
  26. package/distribution/components/utilities/Toolbar/General/components/MenuMore/components/Viewcube/index.d.ts +5 -1
  27. package/distribution/components/utilities/Toolbar/General/components/MenuMore/index.d.ts +5 -1
  28. package/distribution/components/utilities/Toolbar/General/components/MenuUniverses/index.d.ts +5 -1
  29. package/distribution/components/utilities/Toolbar/General/components/ToolbarRotate/index.d.ts +9 -1
  30. package/distribution/components/utilities/Toolbar/General/components/ToolbarScale/index.d.ts +9 -1
  31. package/distribution/components/utilities/Toolbar/General/components/ToolbarTranslate/index.d.ts +9 -1
  32. package/distribution/components/utilities/Toolbar/General/components/TransformArrow/index.d.ts +9 -1
  33. package/distribution/components/utilities/Toolbar/General/index.d.ts +5 -1
  34. package/distribution/components/utilities/UniverseExplorer/index.d.ts +5 -1
  35. package/distribution/components/utilities/Viewcube/components/ViewcubeFace/index.d.ts +12 -1
  36. package/distribution/components/utilities/Viewcube/components/ViewcubeModel/index.d.ts +6 -1
  37. package/distribution/components/utilities/Viewcube/components/ViewcubeTransformAreas/index.d.ts +5 -1
  38. package/distribution/components/utilities/Viewcube/index.d.ts +5 -1
  39. package/distribution/components/virtuals/List/index.d.ts +7 -1
  40. package/distribution/containers/Application/View/index.d.ts +25 -2
  41. package/distribution/containers/Application/index.d.ts +2 -2
  42. package/distribution/containers/Provider/index.d.ts +1 -1
  43. package/distribution/containers/RouterBrowser/index.d.ts +2 -2
  44. package/distribution/containers/RouterStatic/index.d.ts +2 -2
  45. package/distribution/index.d.ts +100 -16
  46. package/distribution/index.es.js +60 -58
  47. package/distribution/index.es.js.map +1 -1
  48. package/distribution/index.js +346 -366
  49. package/distribution/index.js.map +1 -1
  50. package/distribution/index.min.js +5890 -150
  51. package/distribution/index.min.js.map +1 -1
  52. package/distribution/services/logic/router/index.d.ts +3 -3
  53. package/distribution/services/logic/shortcuts/index.d.ts +102 -3
  54. package/distribution/services/state/actions/index.d.ts +18 -8
  55. package/distribution/services/state/modules/configuration/index.d.ts +15 -3
  56. package/distribution/services/state/modules/general/index.d.ts +1 -1
  57. package/distribution/services/state/modules/shortcuts/index.d.ts +1 -1
  58. package/distribution/services/state/modules/space/index.d.ts +3 -1
  59. package/distribution/services/state/modules/themes/index.d.ts +1 -1
  60. package/distribution/services/state/modules/ui/index.d.ts +1 -1
  61. package/package.json +38 -36
@@ -16,7 +16,7 @@ import { connect, Provider } from "react-redux";
16
16
 
17
17
  import { createSlice, combineReducers, configureStore } from "@reduxjs/toolkit";
18
18
 
19
- import { mathematics, dom, meta, objects, uuid, storage } from "@plurid/plurid-functions";
19
+ import { mathematics, objects, dom, meta, uuid, storage } from "@plurid/plurid-functions";
20
20
 
21
21
  import themes$2, { plurid, decomposeColor } from "@plurid/plurid-themes";
22
22
 
@@ -42,9 +42,7 @@ const configuration = createSlice({
42
42
  name: "configuration",
43
43
  initialState: initialState$5,
44
44
  reducers: {
45
- setConfiguration: (state, action) => {
46
- state = Object.assign(Object.assign({}, state), action.payload);
47
- },
45
+ setConfiguration: (_state, action) => Object.assign({}, action.payload),
48
46
  setConfigurationMicro: state => {
49
47
  state.elements.toolbar.show = false;
50
48
  state.elements.plane.controls.show = false;
@@ -168,11 +166,11 @@ const reducer$6 = configuration.reducer;
168
166
 
169
167
  var configuration$1 = Object.freeze({
170
168
  __proto__: null,
171
- configuration: configuration,
172
169
  actions: actions$6,
170
+ configuration: configuration,
173
171
  getConfiguration: getConfiguration,
174
- selectors: selectors$6,
175
- reducer: reducer$6
172
+ reducer: reducer$6,
173
+ selectors: selectors$6
176
174
  });
177
175
 
178
176
  const initialState$4 = {};
@@ -195,11 +193,11 @@ const reducer$5 = general.reducer;
195
193
 
196
194
  var general$1 = Object.freeze({
197
195
  __proto__: null,
198
- general: general,
199
196
  actions: actions$5,
197
+ general: general,
200
198
  getGeneral: getGeneral,
201
- selectors: selectors$5,
202
- reducer: reducer$5
199
+ reducer: reducer$5,
200
+ selectors: selectors$5
203
201
  });
204
202
 
205
203
  const initialState$3 = {
@@ -228,11 +226,11 @@ const reducer$4 = shortcuts.reducer;
228
226
 
229
227
  var shortcuts$1 = Object.freeze({
230
228
  __proto__: null,
231
- shortcuts: shortcuts,
232
229
  actions: actions$4,
233
230
  getGlobal: getGlobal,
231
+ reducer: reducer$4,
234
232
  selectors: selectors$4,
235
- reducer: reducer$4
233
+ shortcuts: shortcuts
236
234
  });
237
235
 
238
236
  const {registerPlanes: registerPlanes, getRegisteredPlanes: getRegisteredPlanes, getPlanesRegistrar: getPlanesRegistrar, getPluridPlaneIDByData: getPluridPlaneIDByData$1, getRegisteredPlane: getRegisteredPlane, resolvePluridRoutePlaneData: resolvePluridRoutePlaneData, resolvePluridPlaneData: resolvePluridPlaneData, Registrar: PluridPlanesRegistrar} = planes;
@@ -319,27 +317,27 @@ const getLastClosedPlane = state => state.space.lastClosedPlane;
319
317
 
320
318
  var selectors$3 = Object.freeze({
321
319
  __proto__: null,
322
- getSpace: getSpace,
320
+ getActivePlaneID: getActivePlaneID,
321
+ getActiveUniverseID: getActiveUniverseID,
322
+ getAnimatedTransform: getAnimatedTransform,
323
+ getCulledView: getCulledView,
324
+ getIsolatePlane: getIsolatePlane,
325
+ getLastClosedPlane: getLastClosedPlane,
323
326
  getLoading: getLoading,
324
327
  getResolvedLayout: getResolvedLayout,
325
- getTransformMatrix: getTransformMatrix,
326
- getAnimatedTransform: getAnimatedTransform,
327
- getTransformTime: getTransformTime,
328
328
  getRotationX: getRotationX,
329
329
  getRotationY: getRotationY,
330
+ getScale: getScale,
331
+ getSpace: getSpace,
332
+ getTransform: getTransform,
333
+ getTransformMatrix: getTransformMatrix,
334
+ getTransformTime: getTransformTime,
330
335
  getTranslationX: getTranslationX,
331
336
  getTranslationY: getTranslationY,
332
337
  getTranslationZ: getTranslationZ,
333
- getScale: getScale,
334
338
  getTree: getTree,
335
- getTransform: getTransform,
336
- getActiveUniverseID: getActiveUniverseID,
337
339
  getView: getView,
338
- getViewSize: getViewSize,
339
- getCulledView: getCulledView,
340
- getActivePlaneID: getActivePlaneID,
341
- getIsolatePlane: getIsolatePlane,
342
- getLastClosedPlane: getLastClosedPlane
340
+ getViewSize: getViewSize
343
341
  });
344
342
 
345
343
  const {toRadians: toRadians} = mathematics.geometry;
@@ -602,6 +600,10 @@ const space = createSlice({
602
600
  },
603
601
  spaceSetCulledView: (state, action) => {
604
602
  state.culledView = action.payload;
603
+ },
604
+ removePlane: (state, action) => {
605
+ const updatedTree = space$2.tree.logic.removePlaneFromTree(objects.clone(state.tree), action.payload);
606
+ state.tree = updatedTree;
605
607
  }
606
608
  }
607
609
  });
@@ -612,11 +614,11 @@ const reducer$3 = space.reducer;
612
614
 
613
615
  var space$1 = Object.freeze({
614
616
  __proto__: null,
615
- name: name,
616
- space: space,
617
617
  actions: actions$3,
618
+ name: name,
619
+ reducer: reducer$3,
618
620
  selectors: selectors$3,
619
- reducer: reducer$3
621
+ space: space
620
622
  });
621
623
 
622
624
  const initialState$1 = {
@@ -652,12 +654,12 @@ const reducer$2 = themes.reducer;
652
654
 
653
655
  var themes$1 = Object.freeze({
654
656
  __proto__: null,
655
- themes: themes,
656
657
  actions: actions$2,
657
658
  getGeneralTheme: getGeneralTheme,
658
659
  getInteractionTheme: getInteractionTheme,
660
+ reducer: reducer$2,
659
661
  selectors: selectors$2,
660
- reducer: reducer$2
662
+ themes: themes
661
663
  });
662
664
 
663
665
  const initialState = {
@@ -686,11 +688,11 @@ const reducer$1 = ui.reducer;
686
688
 
687
689
  var ui$1 = Object.freeze({
688
690
  __proto__: null,
689
- ui: ui,
690
691
  actions: actions$1,
691
692
  getToolbarScrollPosition: getToolbarScrollPosition,
693
+ reducer: reducer$1,
692
694
  selectors: selectors$1,
693
- reducer: reducer$1
695
+ ui: ui
694
696
  });
695
697
 
696
698
  var modules = {
@@ -4346,7 +4348,7 @@ const PluridView = properties => {
4346
4348
  dispatchSetTree(computedTree);
4347
4349
  };
4348
4350
  const treeUpdateCallback = useCallback((() => {
4349
- treeUpdate(stateSpaceView, stateConfiguration);
4351
+ treeUpdate(stateSpaceView, stateConfiguration, true);
4350
4352
  }), [ hostname, stateSpaceView, stateConfiguration, JSON.stringify(stateTree) ]);
4351
4353
  const handlePubSubSubscribe = pubsub => {
4352
4354
  const subscriptions = [ {
@@ -4450,14 +4452,14 @@ const PluridView = properties => {
4450
4452
  const {plane: plane} = data;
4451
4453
  const updatedView = [ ...stateSpaceView, plane ];
4452
4454
  dispatchSpaceSetView(updatedView);
4453
- treeUpdate(updatedView);
4455
+ treeUpdate(updatedView, undefined, true);
4454
4456
  }
4455
4457
  }, {
4456
4458
  topic: PLURID_PUBSUB_TOPIC.VIEW_SET_PLANES,
4457
4459
  callback: data => {
4458
4460
  const {view: view} = data;
4459
4461
  dispatchSpaceSetView([ ...view ]);
4460
- treeUpdate(view);
4462
+ treeUpdate(view, undefined, true);
4461
4463
  }
4462
4464
  }, {
4463
4465
  topic: PLURID_PUBSUB_TOPIC.VIEW_REMOVE_PLANE,
@@ -4757,7 +4759,7 @@ const PluridView = properties => {
4757
4759
  return () => {
4758
4760
  window.removeEventListener("resize", treeUpdateCallback);
4759
4761
  };
4760
- }), [ stateSpaceView, stateConfiguration, JSON.stringify(stateTree) ]);
4762
+ }), [ stateSpaceView, JSON.stringify(stateConfiguration), JSON.stringify(stateTree) ]);
4761
4763
  useEffect((() => {
4762
4764
  if (typeof window === "undefined") {
4763
4765
  return;
@@ -4838,12 +4840,12 @@ const PluridView = properties => {
4838
4840
  unsubscriber();
4839
4841
  }
4840
4842
  };
4841
- }), [ state.space.lastClosedPlane, pluridPubSub.length, JSON.stringify(stateTree) ]);
4843
+ }), [ state.space.lastClosedPlane, pluridPubSub.length, JSON.stringify(stateTree), JSON.stringify(stateConfiguration) ]);
4842
4844
  useEffect((() => {
4843
4845
  for (const pubsub of pluridPubSub) {
4844
4846
  handlePubSubPublish(pubsub);
4845
4847
  }
4846
- }), [ pluridPubSub.length, stateConfiguration, stateTransform ]);
4848
+ }), [ pluridPubSub.length, JSON.stringify(stateConfiguration), stateTransform ]);
4847
4849
  useEffect((() => {
4848
4850
  treeUpdateCallback();
4849
4851
  }), []);
@@ -5695,7 +5697,7 @@ const PluridLink = properties => {
5695
5697
  if (!planesRegistry) {
5696
5698
  return React.createElement(React.Fragment, null, properties.children);
5697
5699
  }
5698
- const {children: children, route: planeRoute, devisible: devisibleProperty, suffix: suffixProperty, atClick: atClick, style: style, className: className, preview: preview, previewComponent: previewComponent, previewFadeIn: previewFadeIn, previewFadeOut: previewFadeOut, previewOffsetX: previewOffsetX, previewOffsetY: previewOffsetY, stateTree: stateTree, stateLastClosedPlane: stateLastClosedPlane, stateGeneralTheme: stateGeneralTheme, stateConfiguration: stateConfiguration, stateViewSize: stateViewSize, dispatch: dispatch, dispatchSetTree: dispatchSetTree, dispatchSetSpaceField: dispatchSetSpaceField, dispatchUpdateSpaceLinkCoordinates: dispatchUpdateSpaceLinkCoordinates} = properties;
5700
+ const {children: children, route: planeRoute, devisible: devisibleProperty, suffix: suffixProperty, atClick: atClick, style: style, className: className, preview: preview, previewComponent: previewComponent, previewFadeIn: previewFadeIn, previewFadeOut: previewFadeOut, previewOffsetX: previewOffsetX, previewOffsetY: previewOffsetY, stateTree: stateTree, stateLastClosedPlane: stateLastClosedPlane, stateGeneralTheme: stateGeneralTheme, stateConfiguration: stateConfiguration, stateViewSize: stateViewSize, dispatch: dispatch, dispatchSetTree: dispatchSetTree, dispatchSetSpaceField: dispatchSetSpaceField, dispatchUpdateSpaceLinkCoordinates: dispatchUpdateSpaceLinkCoordinates, dispatchRemovePlane: dispatchRemovePlane} = properties;
5699
5701
  const planeControls = stateConfiguration.elements.plane.controls.show;
5700
5702
  const previewAppearTime = previewFadeIn || PLURID_DEFAULT_CONFIGURATION_LINK_PREVIEW_FADE_IN;
5701
5703
  const previewDisappearTime = previewFadeOut || PLURID_DEFAULT_CONFIGURATION_LINK_PREVIEW_FADE_OUT;
@@ -5706,7 +5708,6 @@ const PluridLink = properties => {
5706
5708
  const linkElement = useRef(null);
5707
5709
  const hoverInTimeout = useRef(null);
5708
5710
  const hoverOutTimeout = useRef(null);
5709
- const planeRef = useRef();
5710
5711
  const [mouseOver, setMouseOver] = useState(false);
5711
5712
  const [showPreview, setShowPreview] = useState(false);
5712
5713
  const [showLink, setShowLink] = useState(false);
@@ -5784,6 +5785,9 @@ const PluridLink = properties => {
5784
5785
  continue;
5785
5786
  }
5786
5787
  if (plane.linkCoordinates.x === linkCoordinates.x || plane.linkCoordinates.y === linkCoordinates.y) {
5788
+ if (pluridPlaneID === plane.planeID) {
5789
+ continue;
5790
+ }
5787
5791
  setShowLink(true);
5788
5792
  setPluridPlaneID(plane.planeID);
5789
5793
  }
@@ -5849,9 +5853,12 @@ const PluridLink = properties => {
5849
5853
  }
5850
5854
  };
5851
5855
  const removePlane = () => {
5852
- const updatedTree = space$2.tree.logic.removePlaneFromTree(objects.clone(stateTree), pluridPlaneID);
5853
- dispatchSetTree(updatedTree);
5854
- setShowLink((show => !show));
5856
+ const pluridPlane = document.getElementById(pluridPlaneID);
5857
+ if (!pluridPlane) {
5858
+ return;
5859
+ }
5860
+ dispatchRemovePlane(pluridPlaneID);
5861
+ setShowLink(false);
5855
5862
  setShowPreview(false);
5856
5863
  };
5857
5864
  const handleClick = useCallback((event => {
@@ -5871,11 +5878,11 @@ const PluridLink = properties => {
5871
5878
  return;
5872
5879
  };
5873
5880
  useEffect((() => {
5874
- const parentPlaneID = getPluridPlaneIDByData$1(linkElement.current);
5875
- setParentPlaneID(parentPlaneID);
5881
+ const newParentPlaneID = getPluridPlaneIDByData$1(linkElement.current);
5882
+ setParentPlaneID(newParentPlaneID);
5876
5883
  const linkCoordinates = getPluridLinkCoordinates();
5877
5884
  setLinkCoordinates(linkCoordinates);
5878
- const parentPlane = space$2.tree.logic.getTreePlaneByID(stateTree, parentPlaneID);
5885
+ const parentPlane = space$2.tree.logic.getTreePlaneByID(stateTree, newParentPlaneID);
5879
5886
  assignTreePlaneToLink(parentPlane, linkCoordinates);
5880
5887
  }), []);
5881
5888
  useEffect((() => {
@@ -5910,7 +5917,6 @@ const PluridLink = properties => {
5910
5917
  }
5911
5918
  };
5912
5919
  }), [ preview, mouseOver ]);
5913
- useEffect((() => {}), []);
5914
5920
  useEffect((() => {
5915
5921
  const openClosedPlaneIndex = defaultPubSub.subscribe({
5916
5922
  topic: PLURID_PUBSUB_TOPIC.OPEN_CLOSED_PLANE,
@@ -5949,17 +5955,12 @@ const PluridLink = properties => {
5949
5955
  defaultPubSub.unsubscribe(closePlaneIndex);
5950
5956
  };
5951
5957
  }), [ showLink, pluridPlaneID, JSON.stringify(stateTree) ]);
5952
- useEffect((() => {
5953
- const plane = space$2.tree.logic.getTreePlaneByID(stateTree, pluridPlaneID);
5954
- planeRef.current = plane;
5955
- return () => {
5956
- setTimeout((() => {
5957
- var _a;
5958
- if (showLink && linkElement.current === null && ((_a = planeRef.current) === null || _a === void 0 ? void 0 : _a.show) === false) {
5959
- removePlane();
5960
- }
5961
- }), 10);
5962
- };
5958
+ useEffect((() => () => {
5959
+ setTimeout((() => {
5960
+ if (pluridPlaneID && showLink && linkElement.current === null) {
5961
+ removePlane();
5962
+ }
5963
+ }), 10);
5963
5964
  }), [ showLink, showPreview, pluridPlaneID, parentPlaneID, JSON.stringify(stateTree) ]);
5964
5965
  return React.createElement(StyledPluridLink, {
5965
5966
  ref: linkElement,
@@ -5998,7 +5999,8 @@ const mapDispatchToProperties$5 = dispatch => ({
5998
5999
  dispatch: dispatch,
5999
6000
  dispatchSetTree: payload => dispatch(actions.space.setTree(payload)),
6000
6001
  dispatchSetSpaceField: payload => dispatch(actions.space.setSpaceField(payload)),
6001
- dispatchUpdateSpaceLinkCoordinates: payload => dispatch(actions.space.updateSpaceLinkCoordinates(payload))
6002
+ dispatchUpdateSpaceLinkCoordinates: payload => dispatch(actions.space.updateSpaceLinkCoordinates(payload)),
6003
+ dispatchRemovePlane: payload => dispatch(actions.space.removePlane(payload))
6002
6004
  });
6003
6005
 
6004
6006
  const ConnectedPluridLink = connect(mapStateToProperties$5, mapDispatchToProperties$5, null, {