@itwin/appui-react 3.4.0-dev.8 → 3.4.0-dev.9
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/lib/cjs/appui-react/content/FloatingViewportContent.d.ts.map +1 -1
- package/lib/cjs/appui-react/content/FloatingViewportContent.js +5 -5
- package/lib/cjs/appui-react/content/FloatingViewportContent.js.map +1 -1
- package/lib/esm/appui-react/content/FloatingViewportContent.d.ts.map +1 -1
- package/lib/esm/appui-react/content/FloatingViewportContent.js +5 -5
- package/lib/esm/appui-react/content/FloatingViewportContent.js.map +1 -1
- package/package.json +32 -32
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FloatingViewportContent.d.ts","sourceRoot":"","sources":["../../../../src/appui-react/content/FloatingViewportContent.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,+BAA+B,CAAC;AACvC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAA6B,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAW5E;;GAEG;AACH,MAAM,WAAW,4BAA4B;IAC3C,wFAAwF;IACxF,aAAa,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,KAAK,OAAO,CAAC;IACjD,wCAAwC;IACxC,SAAS,EAAE,MAAM,CAAC;IAClB,yDAAyD;IACzD,gBAAgB,EAAE,SAAS,CAAC;CAC7B;AAED;;;;;GAKG;AAEH,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,4BAA4B,
|
|
1
|
+
{"version":3,"file":"FloatingViewportContent.d.ts","sourceRoot":"","sources":["../../../../src/appui-react/content/FloatingViewportContent.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,+BAA+B,CAAC;AACvC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAA6B,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAW5E;;GAEG;AACH,MAAM,WAAW,4BAA4B;IAC3C,wFAAwF;IACxF,aAAa,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,KAAK,OAAO,CAAC;IACjD,wCAAwC;IACxC,SAAS,EAAE,MAAM,CAAC;IAClB,yDAAyD;IACzD,gBAAgB,EAAE,SAAS,CAAC;CAC7B;AAED;;;;;GAKG;AAEH,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,4BAA4B,eA2D1E"}
|
|
@@ -43,16 +43,16 @@ function FloatingViewportContent(props) {
|
|
|
43
43
|
}
|
|
44
44
|
};
|
|
45
45
|
}, [contentId]);
|
|
46
|
-
const viewPortControl = React.useMemo(() => initialViewState ? (React.createElement(FloatingViewport, { viewportRef: onViewportRef, imodel: initialViewState.iModel, viewState: initialViewState, onContextMenu: props.onContextMenu })) : undefined, [onViewportRef, props.onContextMenu, initialViewState]);
|
|
46
|
+
const viewPortControl = React.useMemo(() => initialViewState ? (React.createElement(FloatingViewport, { viewportRef: onViewportRef, imodel: initialViewState.iModel, viewState: initialViewState, onContextMenu: props.onContextMenu, controlId: contentId })) : undefined, [onViewportRef, props.onContextMenu, initialViewState, contentId]);
|
|
47
47
|
React.useEffect(() => {
|
|
48
48
|
if (viewport && contentControl.current) {
|
|
49
49
|
contentControl.current.viewport = viewport;
|
|
50
50
|
if (null === contentControl.current.reactNode) {
|
|
51
51
|
contentControl.current.reactNode = viewPortControl;
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
52
|
+
}
|
|
53
|
+
if (initialViewState) {
|
|
54
|
+
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
|
55
|
+
contentControl.current.processViewSelectorChange(initialViewState.iModel, initialViewState.id, initialViewState, initialViewState.name);
|
|
56
56
|
}
|
|
57
57
|
}
|
|
58
58
|
}, [initialViewState, viewPortControl, viewport]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FloatingViewportContent.js","sourceRoot":"","sources":["../../../../src/appui-react/content/FloatingViewportCont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AgB,CAAC,CAAC,CAAC,CACjB,oBAAC,gBAAgB,IACf,WAAW,EAAE,aAAa,EAC1B,MAAM,EAAE,gBAAgB,CAAC,MAAM,EAC/B,SAAS,EAAE,gBAAgB,EAC3B,aAAa,EAAE,KAAK,CAAC,aAAa,
|
|
1
|
+
{"version":3,"file":"FloatingViewportContent.js","sourceRoot":"","sources":["../../../../src/appui-react/content/FloatingViewportContent.tsx"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,yCAAuC;AACvC,+BAA+B;AAC/B,wDAA4E;AAC5E,4EAA0E;AAC1E,4EAAmE;AACnE,qEAA0E;AAC1E,6DAA0D;AAC1D,kEAA+D;AAC/D,mDAAiD;AAEjD,gEAAgE;AAChE,MAAM,gBAAgB,GAAG,IAAA,kDAAwB,EAAC,2CAAiB,CAAC,CAAC;AAcrE;;;;;GAKG;AACH,uBAAuB;AACvB,SAAgB,uBAAuB,CAAC,KAAmC;IACzE,MAAM,EAAE,SAAS,EAAE,gBAAgB,EAAE,GAAG,KAAK,CAAC;IAC9C,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,GAAG,KAAK,CAAC,QAAQ,EAA8B,CAAC;IAC7E,MAAM,cAAc,GAAG,KAAK,CAAC,MAAM,EAA8C,CAAC;IAElF,MAAM,aAAa,GAAG,KAAK,CAAC,WAAW,CAAC,CAAC,CAAiB,EAAE,EAAE,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;IAEnF,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACnB,IAAI,CAAC,cAAc,CAAC,OAAO,EAAE;YAC3B,cAAc,CAAC,OAAO,GAAG,IAAI,uDAA8B,CAAC,SAAS,EAAE,SAAS,EAAE,IAAI,CAAC,CAAC;YACxF,uCAAkB,CAAC,yBAAyB,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC;SACtE;QACD,OAAO,GAAG,EAAE;YACV,IAAI,cAAc,CAAC,OAAO,EAAE;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cAAc,CAAC,OAAO,0CAAE,QAAQ,MAAK,EAAE,EAAE;gBAC3C,uCAAkB,CAAC,0BAA0B,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC;gBACtE,cAAc,CAAC,OAAO,GAAG,SAAS,CAAC;aACpC;QACH,CAAC,CAAC;QACF,OAAO,yBAAS,CAAC,WAAW,CAAC,WAAW,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC;IACpE,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO,CACL,6BAAK,WAAW,EAAE,qCAAiB,CAAC,sBAAsB,EAAE,SAAS,EAAC,4BAA4B,EAAC,KAAK,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,UAAU,EAAE;QAChJ,oBAAC,8BAAc,IAAC,OAAO,EAAE,eAAe,EAAE,KAAK,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,UAAU,EAAE,GAAI,CACzF,CACP,CAAC;AACJ,CAAC;AA3DD,0DA2DC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module ContentView\r\n */\r\n\r\nimport \"./FloatingViewportContent.css\";\r\nimport * as React from \"react\";\r\nimport { IModelApp, ScreenViewport, ViewState } from \"@itwin/core-frontend\";\r\nimport { viewWithUnifiedSelection } from \"@itwin/presentation-components\";\r\nimport { ViewportComponent } from \"@itwin/imodel-components-react\";\r\nimport { FloatingViewportContentControl } from \"./ViewportContentControl\";\r\nimport { ContentViewManager } from \"./ContentViewManager\";\r\nimport { UiShowHideManager } from \"../utils/UiShowHideManager\";\r\nimport { ContentWrapper } from \"./ContentLayout\";\r\n\r\n// eslint-disable-next-line @typescript-eslint/naming-convention\r\nconst FloatingViewport = viewWithUnifiedSelection(ViewportComponent);\r\n\r\n/**\r\n * @beta\r\n */\r\nexport interface FloatingViewportContentProps {\r\n /** callback used to construct context menu when user right-clicks on canvas/viewport */\r\n onContextMenu?: (e: React.MouseEvent) => boolean;\r\n /** viewport/content control uniqueId */\r\n contentId: string;\r\n /** The initial view state used to create the viewport */\r\n initialViewState: ViewState;\r\n}\r\n\r\n/**\r\n * FloatingViewportContent component that creates its own [FloatingViewportContentControl].\r\n * This allows it to be recognized as an \"active\" content control so that tools operate on this\r\n * content.\r\n * @beta\r\n */\r\n// istanbul ignore next\r\nexport function FloatingViewportContent(props: FloatingViewportContentProps) { // eslint-disable-line @typescript-eslint/naming-convention\r\n const { contentId, initialViewState } = props;\r\n const [viewport, setViewport] = React.useState<ScreenViewport | undefined>();\r\n const contentControl = React.useRef<FloatingViewportContentControl | undefined>();\r\n\r\n const onViewportRef = React.useCallback((v: ScreenViewport) => setViewport(v), []);\r\n\r\n React.useEffect(() => {\r\n if (!contentControl.current) {\r\n contentControl.current = new FloatingViewportContentControl(contentId, contentId, null);\r\n ContentViewManager.addFloatingContentControl(contentControl.current);\r\n }\r\n return () => {\r\n if (contentControl.current) {\r\n ContentViewManager.dropFloatingContentControl(contentControl.current);\r\n contentControl.current = undefined;\r\n }\r\n };\r\n }, [contentId]);\r\n\r\n const viewPortControl = React.useMemo(() =>\r\n initialViewState ? (\r\n <FloatingViewport\r\n viewportRef={onViewportRef}\r\n imodel={initialViewState.iModel}\r\n viewState={initialViewState}\r\n onContextMenu={props.onContextMenu}\r\n controlId={contentId}\r\n />\r\n ) : undefined, [onViewportRef, props.onContextMenu, initialViewState, contentId]);\r\n\r\n React.useEffect(() => {\r\n if (viewport && contentControl.current) {\r\n contentControl.current.viewport = viewport;\r\n if (null === contentControl.current.reactNode) {\r\n contentControl.current.reactNode = viewPortControl;\r\n }\r\n if (initialViewState) {\r\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\r\n contentControl.current.processViewSelectorChange(initialViewState.iModel, initialViewState.id, initialViewState, initialViewState.name);\r\n }\r\n }\r\n }, [initialViewState, viewPortControl, viewport]);\r\n\r\n React.useEffect(() => {\r\n const onViewClose = (vp: ScreenViewport) => {\r\n if (contentControl.current?.viewport === vp) {\r\n ContentViewManager.dropFloatingContentControl(contentControl.current);\r\n contentControl.current = undefined;\r\n }\r\n };\r\n return IModelApp.viewManager.onViewClose.addListener(onViewClose);\r\n }, []);\r\n\r\n return (\r\n <div onMouseMove={UiShowHideManager.handleContentMouseMove} className=\"uifw-dialog-imodel-content\" style={{ height: \"100%\", position: \"relative\" }}>\r\n <ContentWrapper content={viewPortControl} style={{ height: \"100%\", position: \"relative\" }} />\r\n </div>\r\n );\r\n}\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FloatingViewportContent.d.ts","sourceRoot":"","sources":["../../../../src/appui-react/content/FloatingViewportContent.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,+BAA+B,CAAC;AACvC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAA6B,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAW5E;;GAEG;AACH,MAAM,WAAW,4BAA4B;IAC3C,wFAAwF;IACxF,aAAa,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,KAAK,OAAO,CAAC;IACjD,wCAAwC;IACxC,SAAS,EAAE,MAAM,CAAC;IAClB,yDAAyD;IACzD,gBAAgB,EAAE,SAAS,CAAC;CAC7B;AAED;;;;;GAKG;AAEH,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,4BAA4B,
|
|
1
|
+
{"version":3,"file":"FloatingViewportContent.d.ts","sourceRoot":"","sources":["../../../../src/appui-react/content/FloatingViewportContent.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,+BAA+B,CAAC;AACvC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAA6B,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAW5E;;GAEG;AACH,MAAM,WAAW,4BAA4B;IAC3C,wFAAwF;IACxF,aAAa,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,KAAK,OAAO,CAAC;IACjD,wCAAwC;IACxC,SAAS,EAAE,MAAM,CAAC;IAClB,yDAAyD;IACzD,gBAAgB,EAAE,SAAS,CAAC;CAC7B;AAED;;;;;GAKG;AAEH,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,4BAA4B,eA2D1E"}
|
|
@@ -40,16 +40,16 @@ export function FloatingViewportContent(props) {
|
|
|
40
40
|
}
|
|
41
41
|
};
|
|
42
42
|
}, [contentId]);
|
|
43
|
-
const viewPortControl = React.useMemo(() => initialViewState ? (React.createElement(FloatingViewport, { viewportRef: onViewportRef, imodel: initialViewState.iModel, viewState: initialViewState, onContextMenu: props.onContextMenu })) : undefined, [onViewportRef, props.onContextMenu, initialViewState]);
|
|
43
|
+
const viewPortControl = React.useMemo(() => initialViewState ? (React.createElement(FloatingViewport, { viewportRef: onViewportRef, imodel: initialViewState.iModel, viewState: initialViewState, onContextMenu: props.onContextMenu, controlId: contentId })) : undefined, [onViewportRef, props.onContextMenu, initialViewState, contentId]);
|
|
44
44
|
React.useEffect(() => {
|
|
45
45
|
if (viewport && contentControl.current) {
|
|
46
46
|
contentControl.current.viewport = viewport;
|
|
47
47
|
if (null === contentControl.current.reactNode) {
|
|
48
48
|
contentControl.current.reactNode = viewPortControl;
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
49
|
+
}
|
|
50
|
+
if (initialViewState) {
|
|
51
|
+
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
|
52
|
+
contentControl.current.processViewSelectorChange(initialViewState.iModel, initialViewState.id, initialViewState, initialViewState.name);
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
55
|
}, [initialViewState, viewPortControl, viewport]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FloatingViewportContent.js","sourceRoot":"","sources":["../../../../src/appui-react/content/FloatingViewportCont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O,GAAG,EAAE;YACV,IAAI,cAAc,CAAC,OAAO,EAAE;gBAC1B,kBAAkB,CAAC,0BAA0B,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC;gBACtE,cAAc,CAAC,OAAO,GAAG,SAAS,CAAC;aACpC;QACH,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC;IAEhB,MAAM,eAAe,GAAG,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,CACzC,gBAAgB,CAAC,CAAC,CAAC,CACjB,oBAAC,gBAAgB,IACf,WAAW,EAAE,aAAa,EAC1B,MAAM,EAAE,gBAAgB,CAAC,MAAM,EAC/B,SAAS,EAAE,gBAAgB,EAC3B,aAAa,EAAE,KAAK,CAAC,aAAa,
|
|
1
|
+
{"version":3,"file":"FloatingViewportContent.js","sourceRoot":"","sources":["../../../../src/appui-react/content/FloatingViewportContent.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,+BAA+B,CAAC;AACvC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,SAAS,EAA6B,MAAM,sBAAsB,CAAC;AAC5E,OAAO,EAAE,wBAAwB,EAAE,MAAM,gCAAgC,CAAC;AAC1E,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AACnE,OAAO,EAAE,8BAA8B,EAAE,MAAM,0BAA0B,CAAC;AAC1E,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEjD,gEAAgE;AAChE,MAAM,gBAAgB,GAAG,wBAAwB,CAAC,iBAAiB,CAAC,CAAC;AAcrE;;;;;GAKG;AACH,uBAAuB;AACvB,MAAM,UAAU,uBAAuB,CAAC,KAAmC;IACzE,MAAM,EAAE,SAAS,EAAE,gBA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------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module ContentView\r\n */\r\n\r\nimport \"./FloatingViewportContent.css\";\r\nimport * as React from \"react\";\r\nimport { IModelApp, ScreenViewport, ViewState } from \"@itwin/core-frontend\";\r\nimport { viewWithUnifiedSelection } from \"@itwin/presentation-components\";\r\nimport { ViewportComponent } from \"@itwin/imodel-components-react\";\r\nimport { FloatingViewportContentControl } from \"./ViewportContentControl\";\r\nimport { ContentViewManager } from \"./ContentViewManager\";\r\nimport { UiShowHideManager } from \"../utils/UiShowHideManager\";\r\nimport { ContentWrapper } from \"./ContentLayout\";\r\n\r\n// eslint-disable-next-line @typescript-eslint/naming-convention\r\nconst FloatingViewport = viewWithUnifiedSelection(ViewportComponent);\r\n\r\n/**\r\n * @beta\r\n */\r\nexport interface FloatingViewportContentProps {\r\n /** callback used to construct context menu when user right-clicks on canvas/viewport */\r\n onContextMenu?: (e: React.MouseEvent) => boolean;\r\n /** viewport/content control uniqueId */\r\n contentId: string;\r\n /** The initial view state used to create the viewport */\r\n initialViewState: ViewState;\r\n}\r\n\r\n/**\r\n * FloatingViewportContent component that creates its own [FloatingViewportContentControl].\r\n * This allows it to be recognized as an \"active\" content control so that tools operate on this\r\n * content.\r\n * @beta\r\n */\r\n// istanbul ignore next\r\nexport function FloatingViewportContent(props: FloatingViewportContentProps) { // eslint-disable-line @typescript-eslint/naming-convention\r\n const { contentId, initialViewState } = props;\r\n const [viewport, setViewport] = React.useState<ScreenViewport | undefined>();\r\n const contentControl = React.useRef<FloatingViewportContentControl | undefined>();\r\n\r\n const onViewportRef = React.useCallback((v: ScreenViewport) => setViewport(v), []);\r\n\r\n React.useEffect(() => {\r\n if (!contentControl.current) {\r\n contentControl.current = new FloatingViewportContentControl(contentId, contentId, null);\r\n ContentViewManager.addFloatingContentControl(contentControl.current);\r\n }\r\n return () => {\r\n if (contentControl.current) {\r\n ContentViewManager.dropFloatingContentControl(contentControl.current);\r\n contentControl.current = undefined;\r\n }\r\n };\r\n }, [contentId]);\r\n\r\n const viewPortControl = React.useMemo(() =>\r\n initialViewState ? (\r\n <FloatingViewport\r\n viewportRef={onViewportRef}\r\n imodel={initialViewState.iModel}\r\n viewState={initialViewState}\r\n onContextMenu={props.onContextMenu}\r\n controlId={contentId}\r\n />\r\n ) : undefined, [onViewportRef, props.onContextMenu, initialViewState, contentId]);\r\n\r\n React.useEffect(() => {\r\n if (viewport && contentControl.current) {\r\n contentControl.current.viewport = viewport;\r\n if (null === contentControl.current.reactNode) {\r\n contentControl.current.reactNode = viewPortControl;\r\n }\r\n if (initialViewState) {\r\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\r\n contentControl.current.processViewSelectorChange(initialViewState.iModel, initialViewState.id, initialViewState, initialViewState.name);\r\n }\r\n }\r\n }, [initialViewState, viewPortControl, viewport]);\r\n\r\n React.useEffect(() => {\r\n const onViewClose = (vp: ScreenViewport) => {\r\n if (contentControl.current?.viewport === vp) {\r\n ContentViewManager.dropFloatingContentControl(contentControl.current);\r\n contentControl.current = undefined;\r\n }\r\n };\r\n return IModelApp.viewManager.onViewClose.addListener(onViewClose);\r\n }, []);\r\n\r\n return (\r\n <div onMouseMove={UiShowHideManager.handleContentMouseMove} className=\"uifw-dialog-imodel-content\" style={{ height: \"100%\", position: \"relative\" }}>\r\n <ContentWrapper content={viewPortControl} style={{ height: \"100%\", position: \"relative\" }} />\r\n </div>\r\n );\r\n}\r\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@itwin/appui-react",
|
|
3
|
-
"version": "3.4.0-dev.
|
|
3
|
+
"version": "3.4.0-dev.9",
|
|
4
4
|
"description": "UI framework",
|
|
5
5
|
"main": "lib/cjs/appui-react.js",
|
|
6
6
|
"module": "lib/esm/appui-react.js",
|
|
@@ -20,19 +20,19 @@
|
|
|
20
20
|
"url": "http://www.bentley.com"
|
|
21
21
|
},
|
|
22
22
|
"peerDependencies": {
|
|
23
|
-
"@itwin/appui-abstract": "^3.4.0-dev.
|
|
24
|
-
"@itwin/appui-layout-react": "^3.4.0-dev.
|
|
25
|
-
"@itwin/components-react": "^3.4.0-dev.
|
|
26
|
-
"@itwin/core-bentley": "^3.4.0-dev.
|
|
27
|
-
"@itwin/core-common": "^3.4.0-dev.
|
|
28
|
-
"@itwin/core-frontend": "^3.4.0-dev.
|
|
29
|
-
"@itwin/core-geometry": "^3.4.0-dev.
|
|
30
|
-
"@itwin/core-markup": "^3.4.0-dev.
|
|
31
|
-
"@itwin/core-quantity": "^3.4.0-dev.
|
|
32
|
-
"@itwin/core-react": "^3.4.0-dev.
|
|
33
|
-
"@itwin/imodel-components-react": "^3.4.0-dev.
|
|
34
|
-
"@itwin/presentation-common": "^3.4.0-dev.
|
|
35
|
-
"@itwin/presentation-frontend": "^3.4.0-dev.
|
|
23
|
+
"@itwin/appui-abstract": "^3.4.0-dev.9",
|
|
24
|
+
"@itwin/appui-layout-react": "^3.4.0-dev.9",
|
|
25
|
+
"@itwin/components-react": "^3.4.0-dev.9",
|
|
26
|
+
"@itwin/core-bentley": "^3.4.0-dev.9",
|
|
27
|
+
"@itwin/core-common": "^3.4.0-dev.9",
|
|
28
|
+
"@itwin/core-frontend": "^3.4.0-dev.9",
|
|
29
|
+
"@itwin/core-geometry": "^3.4.0-dev.9",
|
|
30
|
+
"@itwin/core-markup": "^3.4.0-dev.9",
|
|
31
|
+
"@itwin/core-quantity": "^3.4.0-dev.9",
|
|
32
|
+
"@itwin/core-react": "^3.4.0-dev.9",
|
|
33
|
+
"@itwin/imodel-components-react": "^3.4.0-dev.9",
|
|
34
|
+
"@itwin/presentation-common": "^3.4.0-dev.9",
|
|
35
|
+
"@itwin/presentation-frontend": "^3.4.0-dev.9",
|
|
36
36
|
"react": "^17.0.0",
|
|
37
37
|
"react-dom": "^17.0.0",
|
|
38
38
|
"react-redux": "^7.2.2",
|
|
@@ -43,22 +43,22 @@
|
|
|
43
43
|
"NOTE: All tools used by scripts in this package must be listed as devDependencies"
|
|
44
44
|
],
|
|
45
45
|
"devDependencies": {
|
|
46
|
-
"@itwin/appui-abstract": "3.4.0-dev.
|
|
47
|
-
"@itwin/appui-layout-react": "3.4.0-dev.
|
|
48
|
-
"@itwin/build-tools": "3.4.0-dev.
|
|
49
|
-
"@itwin/components-react": "3.4.0-dev.
|
|
50
|
-
"@itwin/core-bentley": "3.4.0-dev.
|
|
51
|
-
"@itwin/core-common": "3.4.0-dev.
|
|
52
|
-
"@itwin/core-frontend": "3.4.0-dev.
|
|
53
|
-
"@itwin/core-geometry": "3.4.0-dev.
|
|
54
|
-
"@itwin/core-markup": "3.4.0-dev.
|
|
55
|
-
"@itwin/core-quantity": "3.4.0-dev.
|
|
56
|
-
"@itwin/core-react": "3.4.0-dev.
|
|
57
|
-
"@itwin/eslint-plugin": "3.4.0-dev.
|
|
58
|
-
"@itwin/imodel-components-react": "3.4.0-dev.
|
|
59
|
-
"@itwin/presentation-common": "3.4.0-dev.
|
|
60
|
-
"@itwin/presentation-frontend": "3.4.0-dev.
|
|
61
|
-
"@itwin/presentation-testing": "3.4.0-dev.
|
|
46
|
+
"@itwin/appui-abstract": "3.4.0-dev.9",
|
|
47
|
+
"@itwin/appui-layout-react": "3.4.0-dev.9",
|
|
48
|
+
"@itwin/build-tools": "3.4.0-dev.9",
|
|
49
|
+
"@itwin/components-react": "3.4.0-dev.9",
|
|
50
|
+
"@itwin/core-bentley": "3.4.0-dev.9",
|
|
51
|
+
"@itwin/core-common": "3.4.0-dev.9",
|
|
52
|
+
"@itwin/core-frontend": "3.4.0-dev.9",
|
|
53
|
+
"@itwin/core-geometry": "3.4.0-dev.9",
|
|
54
|
+
"@itwin/core-markup": "3.4.0-dev.9",
|
|
55
|
+
"@itwin/core-quantity": "3.4.0-dev.9",
|
|
56
|
+
"@itwin/core-react": "3.4.0-dev.9",
|
|
57
|
+
"@itwin/eslint-plugin": "3.4.0-dev.9",
|
|
58
|
+
"@itwin/imodel-components-react": "3.4.0-dev.9",
|
|
59
|
+
"@itwin/presentation-common": "3.4.0-dev.9",
|
|
60
|
+
"@itwin/presentation-frontend": "3.4.0-dev.9",
|
|
61
|
+
"@itwin/presentation-testing": "3.4.0-dev.9",
|
|
62
62
|
"@testing-library/react": "^12.0.0",
|
|
63
63
|
"@testing-library/react-hooks": "^7.0.2",
|
|
64
64
|
"@types/chai": "4.3.1",
|
|
@@ -113,8 +113,8 @@
|
|
|
113
113
|
"dependencies": {
|
|
114
114
|
"@bentley/icons-generic": "^1.0.15",
|
|
115
115
|
"@bentley/icons-generic-webfont": "^1.0.15",
|
|
116
|
-
"@itwin/core-telemetry": "3.4.0-dev.
|
|
117
|
-
"@itwin/presentation-components": "3.4.0-dev.
|
|
116
|
+
"@itwin/core-telemetry": "3.4.0-dev.9",
|
|
117
|
+
"@itwin/presentation-components": "3.4.0-dev.9",
|
|
118
118
|
"@itwin/itwinui-css": "0.x",
|
|
119
119
|
"@itwin/itwinui-react": "^1.38.1",
|
|
120
120
|
"@itwin/itwinui-icons-react": "^1.8.0",
|