tungsten 0.3.2 → 0.3.4
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/dist/.build-complete +1 -0
- package/dist/Components.d.ts +6 -1
- package/dist/Components.d.ts.map +1 -1
- package/dist/Components.js +103 -40
- package/dist/DomPointer.d.ts +11 -0
- package/dist/DomPointer.d.ts.map +1 -1
- package/dist/DomPointer.js +15 -0
- package/dist/DomRegion.d.ts +2 -0
- package/dist/DomRegion.d.ts.map +1 -1
- package/dist/DomRegion.js +23 -3
- package/dist/Framework.d.ts +2 -0
- package/dist/Framework.d.ts.map +1 -1
- package/dist/Framework.js +94 -61
- package/dist/FrameworkConfig.d.ts +4 -0
- package/dist/FrameworkConfig.d.ts.map +1 -1
- package/dist/Instance/Instance.d.ts +1 -1
- package/dist/Instance/Instance.d.ts.map +1 -1
- package/dist/Instance/Instance.js +18 -1
- package/dist/Instance/InstanceConfig.d.ts +1 -0
- package/dist/Instance/InstanceConfig.d.ts.map +1 -1
- package/dist/PopMessage.type.d.ts +6 -0
- package/dist/PopMessage.type.d.ts.map +1 -0
- package/dist/PopMessage.type.js +1 -0
- package/dist/Servers/DevServer.d.ts +2 -0
- package/dist/Servers/DevServer.d.ts.map +1 -1
- package/dist/Servers/DevServer.js +87 -11
- package/dist/Servers/MatchedRouteInfo.d.ts +1 -1
- package/dist/Servers/MatchedRouteInfo.d.ts.map +1 -1
- package/dist/Servers/ProdServer.d.ts +2 -1
- package/dist/Servers/ProdServer.d.ts.map +1 -1
- package/dist/Servers/ProdServer.js +92 -8
- package/dist/Servers/hono/DevServerHono.js +25 -29
- package/dist/Servers/hono/ProdServerHono.js +49 -142
- package/dist/Servers/hono/TungstenServerHono.d.ts +1 -1
- package/dist/Servers/hono/TungstenServerHono.d.ts.map +1 -1
- package/dist/Servers/hono/TungstenServerHono.js +12 -29
- package/dist/Servers/loadEnvsDev.d.ts.map +1 -1
- package/dist/Servers/loadEnvsDev.js +16 -5
- package/dist/Servers/routing.d.ts.map +1 -1
- package/dist/Servers/routing.js +10 -6
- package/dist/Servers/tungstenCorePrivateEnvSchema.d.ts +0 -3
- package/dist/Servers/tungstenCorePrivateEnvSchema.d.ts.map +1 -1
- package/dist/Servers/tungstenCorePrivateEnvSchema.js +3 -3
- package/dist/Servers/tungstenCorePublicEnvSchema.d.ts +8 -0
- package/dist/Servers/tungstenCorePublicEnvSchema.d.ts.map +1 -0
- package/dist/Servers/tungstenCorePublicEnvSchema.js +14 -0
- package/dist/Store/InternalStoreSchema.d.ts +2 -0
- package/dist/Store/InternalStoreSchema.d.ts.map +1 -1
- package/dist/Store/InternalStoreSchema.js +1 -0
- package/dist/api/Request.d.ts +1 -1
- package/dist/api/Request.d.ts.map +1 -1
- package/dist/api/Response.d.ts +1 -1
- package/dist/api/Response.d.ts.map +1 -1
- package/dist/babelPlugins/BabelExtractComponentStylesheet.d.ts +13 -0
- package/dist/babelPlugins/BabelExtractComponentStylesheet.d.ts.map +1 -0
- package/dist/babelPlugins/BabelExtractComponentStylesheet.js +24 -0
- package/dist/babelPlugins/BabelTransformComponentStyles.d.ts +2 -0
- package/dist/babelPlugins/BabelTransformComponentStyles.d.ts.map +1 -1
- package/dist/babelPlugins/BabelTransformComponentStyles.js +21 -5
- package/dist/babelPlugins/BabelTransformPackageImports.d.ts +1 -0
- package/dist/babelPlugins/BabelTransformPackageImports.d.ts.map +1 -1
- package/dist/babelPlugins/BabelTransformPackageImports.js +21 -9
- package/dist/babelPlugins/BabelTypes.d.ts +2 -2
- package/dist/babelPlugins/BabelTypes.d.ts.map +1 -1
- package/dist/babelPlugins/BabelTypes.js +0 -1
- package/dist/bin/commands/build.d.ts.map +1 -1
- package/dist/bin/commands/build.js +12 -2
- package/dist/bin/commands/compile.d.ts.map +1 -1
- package/dist/bin/commands/compile.js +7 -2
- package/dist/bin/commands/dev.d.ts.map +1 -1
- package/dist/bin/commands/dev.js +15 -4
- package/dist/bin/commands/devmon.d.ts +2 -0
- package/dist/bin/commands/devmon.d.ts.map +1 -0
- package/dist/bin/commands/devmon.js +66 -0
- package/dist/bin/index.d.ts.map +1 -1
- package/dist/bin/index.js +6 -0
- package/dist/booleanAttributeValue.d.ts +21 -0
- package/dist/booleanAttributeValue.d.ts.map +1 -0
- package/dist/booleanAttributeValue.js +23 -0
- package/dist/build/CompilationInfo.d.ts +1 -0
- package/dist/build/CompilationInfo.d.ts.map +1 -1
- package/dist/build/combineComponentCss.d.ts +1 -1
- package/dist/build/combineComponentCss.d.ts.map +1 -1
- package/dist/build/combineComponentCss.js +3 -3
- package/dist/build/compileJavascript.d.ts.map +1 -1
- package/dist/build/compileJavascript.js +3 -3
- package/dist/build/compileUserApp.d.ts +2 -1
- package/dist/build/compileUserApp.d.ts.map +1 -1
- package/dist/build/compileUserApp.js +18 -8
- package/dist/build/createInstanceConfigFile.js +1 -1
- package/dist/build/frameworkStylesheets.d.ts +5 -0
- package/dist/build/frameworkStylesheets.d.ts.map +1 -0
- package/dist/build/frameworkStylesheets.js +49 -0
- package/dist/build/getPackageDirForFile.d.ts +2 -0
- package/dist/build/getPackageDirForFile.d.ts.map +1 -0
- package/dist/build/getPackageDirForFile.js +11 -0
- package/dist/build/getSxyClientPackageAliases.d.ts.map +1 -1
- package/dist/build/getSxyClientPackageAliases.js +3 -1
- package/dist/build/makeBabelUserDevConfig.d.ts +1 -1
- package/dist/build/makeBabelUserDevConfig.d.ts.map +1 -1
- package/dist/build/makeBabelUserDevConfig.js +3 -2
- package/dist/build/makeBabelUserProdConfig.d.ts +1 -1
- package/dist/build/makeBabelUserProdConfig.d.ts.map +1 -1
- package/dist/build/makeBabelUserProdConfig.js +4 -2
- package/dist/build/rollup.user.prod.config.d.ts.map +1 -1
- package/dist/build/rollup.user.prod.config.js +4 -1
- package/dist/build/rollupExtractComponentStylesheets.d.ts +12 -0
- package/dist/build/rollupExtractComponentStylesheets.d.ts.map +1 -0
- package/dist/build/rollupExtractComponentStylesheets.js +35 -0
- package/dist/compat/context.d.ts +1 -1
- package/dist/compat/context.d.ts.map +1 -1
- package/dist/compat/types.d.ts +1 -1
- package/dist/compat/types.d.ts.map +1 -1
- package/dist/componentCss/i/T-components-library-RichTextEditor-RichTextEditor.css +115 -0
- package/dist/componentCss/i/T-components-library-__StatefulMessage-StatefulMessage.css +25 -0
- package/dist/componentCss/tungsten.css +2 -0
- package/dist/componentProxyHandlers.d.ts +2 -1
- package/dist/componentProxyHandlers.d.ts.map +1 -1
- package/dist/componentProxyHandlers.js +45 -9
- package/dist/components/GoToComponent.d.ts +1 -1
- package/dist/components/GoToComponent.d.ts.map +1 -1
- package/dist/components/PopMessages.d.ts +12 -0
- package/dist/components/PopMessages.d.ts.map +1 -0
- package/dist/components/PopMessages.js +45 -0
- package/dist/components/_GoToComponent.d.ts +10 -0
- package/dist/components/_GoToComponent.d.ts.map +1 -0
- package/dist/components/_GoToComponent.js +13 -0
- package/dist/components/library/RichTextEditor/RichTextEditor.d.ts +50 -0
- package/dist/components/library/RichTextEditor/RichTextEditor.d.ts.map +1 -0
- package/dist/components/library/RichTextEditor/RichTextEditor.js +458 -0
- package/dist/components/library/RichTextEditor/StoredContentNode.d.ts +5 -0
- package/dist/components/library/RichTextEditor/StoredContentNode.d.ts.map +1 -0
- package/dist/components/library/RichTextEditor/StoredContentNode.js +1 -0
- package/dist/components/library/RichTextEditor/activeFormats.d.ts +20 -0
- package/dist/components/library/RichTextEditor/activeFormats.d.ts.map +1 -0
- package/dist/components/library/RichTextEditor/activeFormats.js +48 -0
- package/dist/components/library/RichTextEditor/contentTree.d.ts +30 -0
- package/dist/components/library/RichTextEditor/contentTree.d.ts.map +1 -0
- package/dist/components/library/RichTextEditor/contentTree.js +81 -0
- package/dist/components/library/RichTextEditor/sanitizeAuthoredHtml.d.ts +30 -0
- package/dist/components/library/RichTextEditor/sanitizeAuthoredHtml.d.ts.map +1 -0
- package/dist/components/library/RichTextEditor/sanitizeAuthoredHtml.js +97 -0
- package/dist/components/library/__StatefulMessage/MessageData.d.ts +7 -0
- package/dist/components/library/__StatefulMessage/MessageData.d.ts.map +1 -0
- package/dist/components/library/__StatefulMessage/MessageData.js +1 -0
- package/dist/components/library/__StatefulMessage/StatefulMessage.d.ts +22 -0
- package/dist/components/library/__StatefulMessage/StatefulMessage.d.ts.map +1 -0
- package/dist/components/library/__StatefulMessage/StatefulMessage.js +88 -0
- package/dist/components/library/index.d.ts +5 -0
- package/dist/components/library/index.d.ts.map +1 -0
- package/dist/components/library/index.js +7 -0
- package/dist/defaultConfig.d.ts +2 -0
- package/dist/defaultConfig.d.ts.map +1 -1
- package/dist/defaultConfig.js +3 -1
- package/dist/env/Interfaces.d.ts +2 -1
- package/dist/env/Interfaces.d.ts.map +1 -1
- package/dist/env/getEnvSchemas.d.ts +1 -1
- package/dist/env/getEnvSchemas.d.ts.map +1 -1
- package/dist/env/injectEnv.d.ts +1 -1
- package/dist/env/injectEnv.d.ts.map +1 -1
- package/dist/env/injectEnv.js +16 -6
- package/dist/env/publicEnv.d.ts.map +1 -1
- package/dist/env/publicEnv.js +4 -1
- package/dist/findUserConfig.d.ts +1 -1
- package/dist/frameworkConfigSchema.d.ts +4 -0
- package/dist/frameworkConfigSchema.d.ts.map +1 -1
- package/dist/frameworkConfigSchema.js +2 -1
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/index.js +1 -0
- package/dist/hooks/useInstance.d.ts +3 -0
- package/dist/hooks/useInstance.d.ts.map +1 -0
- package/dist/hooks/useInstance.js +4 -0
- package/dist/hydrate/hydrate.d.ts +6 -4
- package/dist/hydrate/hydrate.d.ts.map +1 -1
- package/dist/hydrate/hydrate.js +51 -13
- package/dist/hydrate/reconcileHydratedAttributes.d.ts.map +1 -1
- package/dist/hydrate/reconcileHydratedAttributes.js +4 -3
- package/dist/hydrate/renderHydrationMismatchBanner.d.ts +7 -0
- package/dist/hydrate/renderHydrationMismatchBanner.d.ts.map +1 -0
- package/dist/hydrate/renderHydrationMismatchBanner.js +69 -0
- package/dist/indexInner.d.ts +13 -5
- package/dist/indexInner.d.ts.map +1 -1
- package/dist/indexInner.js +9 -2
- package/dist/makeInstanceConfigFromFrameworkConfig.d.ts.map +1 -1
- package/dist/makeInstanceConfigFromFrameworkConfig.js +2 -1
- package/dist/pop.d.ts +10 -0
- package/dist/pop.d.ts.map +1 -0
- package/dist/pop.js +49 -0
- package/dist/postcssPlugins/TransformCssNames.d.ts.map +1 -1
- package/dist/postcssPlugins/TransformCssNames.js +10 -2
- package/dist/propsAreEqual.d.ts +8 -0
- package/dist/propsAreEqual.d.ts.map +1 -0
- package/dist/propsAreEqual.js +97 -0
- package/dist/rawHtml/filterContentNode.d.ts +20 -0
- package/dist/rawHtml/filterContentNode.d.ts.map +1 -0
- package/dist/rawHtml/filterContentNode.js +96 -0
- package/dist/rawHtml/parseHtml.d.ts +14 -0
- package/dist/rawHtml/parseHtml.d.ts.map +1 -1
- package/dist/rawHtml/parseHtml.js +4 -4
- package/dist/rawHtml/sanitizeHtml.d.ts +17 -0
- package/dist/rawHtml/sanitizeHtml.d.ts.map +1 -0
- package/dist/rawHtml/sanitizeHtml.js +19 -0
- package/dist/render/HeadData.d.ts +2 -0
- package/dist/render/HeadData.d.ts.map +1 -1
- package/dist/render/contentNodeToHtml.d.ts +18 -0
- package/dist/render/contentNodeToHtml.d.ts.map +1 -0
- package/dist/render/contentNodeToHtml.js +66 -0
- package/dist/render/contentToHtml.d.ts.map +1 -1
- package/dist/render/contentToHtml.js +3 -1
- package/dist/render/instantiateClassComponent.d.ts.map +1 -1
- package/dist/render/instantiateClassComponent.js +4 -0
- package/dist/render/processHead.d.ts.map +1 -1
- package/dist/render/processHead.js +22 -3
- package/dist/render/renderingTreeToHtml.d.ts.map +1 -1
- package/dist/render/renderingTreeToHtml.js +8 -1
- package/dist/routing/ErrorRouteType.d.ts +6 -0
- package/dist/routing/ErrorRouteType.d.ts.map +1 -0
- package/dist/routing/ErrorRouteType.js +1 -0
- package/dist/routing/RouteTypes.d.ts +2 -1
- package/dist/routing/RouteTypes.d.ts.map +1 -1
- package/dist/routing/Routes.d.ts +5 -0
- package/dist/routing/Routes.d.ts.map +1 -1
- package/dist/routing/TungstenErrorInfo.d.ts +6 -0
- package/dist/routing/TungstenErrorInfo.d.ts.map +1 -0
- package/dist/routing/TungstenErrorInfo.js +6 -0
- package/dist/settings.d.ts +2 -0
- package/dist/settings.d.ts.map +1 -1
- package/dist/settings.js +3 -0
- package/dist/stateTracking.d.ts +47 -0
- package/dist/stateTracking.d.ts.map +1 -0
- package/dist/stateTracking.js +83 -0
- package/dist/staticGen/staticGen.d.ts.map +1 -1
- package/dist/staticGen/staticGen.js +117 -107
- package/dist/style/styleContentSxy.js +21 -0
- package/dist/testing/hydrateTestApp.d.ts +38 -0
- package/dist/testing/hydrateTestApp.d.ts.map +1 -0
- package/dist/testing/hydrateTestApp.js +242 -0
- package/dist/testing/index.d.ts +4 -3
- package/dist/testing/index.d.ts.map +1 -1
- package/dist/testing/index.js +16 -2
- package/dist/testing/installTestStyleProcessors.d.ts +2 -0
- package/dist/testing/installTestStyleProcessors.d.ts.map +1 -0
- package/dist/testing/installTestStyleProcessors.js +21 -0
- package/dist/testing/temp/componentPackageMock.d.ts +18 -0
- package/dist/testing/temp/componentPackageMock.d.ts.map +1 -0
- package/dist/testing/temp/componentPackageMock.js +37 -0
- package/dist/testing/temp/contentHtmlElements.d.ts +3 -0
- package/dist/testing/temp/contentHtmlElements.d.ts.map +1 -0
- package/dist/testing/temp/contentHtmlElements.js +12 -0
- package/dist/timeProfiler.d.ts +6 -0
- package/dist/timeProfiler.d.ts.map +1 -0
- package/dist/timeProfiler.js +31 -0
- package/dist/update/integrateUpdateVdom.d.ts +11 -0
- package/dist/update/integrateUpdateVdom.d.ts.map +1 -1
- package/dist/update/integrateUpdateVdom.js +169 -54
- package/dist/update/pendingMounts.d.ts +25 -0
- package/dist/update/pendingMounts.d.ts.map +1 -0
- package/dist/update/pendingMounts.js +55 -0
- package/dist/warnOnFrameworkChange.d.ts.map +1 -1
- package/dist/warnOnFrameworkChange.js +8 -8
- package/package.json +21 -17
- package/dist/FunctionComponentStandIn.sxyt.d.ts +0 -2
- package/dist/FunctionComponentStandIn.sxyt.d.ts.map +0 -1
- package/dist/FunctionComponentStandIn.sxyt.js +0 -52
- package/dist/Instance/gotoRedirect.sxyt.d.ts +0 -2
- package/dist/Instance/gotoRedirect.sxyt.d.ts.map +0 -1
- package/dist/Instance/gotoRedirect.sxyt.js +0 -148
- package/dist/Instance/runTrackedWork.sxyt.d.ts +0 -2
- package/dist/Instance/runTrackedWork.sxyt.d.ts.map +0 -1
- package/dist/Instance/runTrackedWork.sxyt.js +0 -35
- package/dist/Servers/devErrorPageAutoRetry.sxyt.d.ts +0 -2
- package/dist/Servers/devErrorPageAutoRetry.sxyt.d.ts.map +0 -1
- package/dist/Servers/devErrorPageAutoRetry.sxyt.js +0 -117
- package/dist/_client/cjsHelpers.sxyt.d.ts +0 -2
- package/dist/_client/cjsHelpers.sxyt.d.ts.map +0 -1
- package/dist/_client/cjsHelpers.sxyt.js +0 -45
- package/dist/auth/passwordHashing.sxyt.d.ts +0 -2
- package/dist/auth/passwordHashing.sxyt.d.ts.map +0 -1
- package/dist/auth/passwordHashing.sxyt.js +0 -46
- package/dist/auth/ref/checkPasswordResetToken.sxyt.d.ts +0 -2
- package/dist/auth/ref/checkPasswordResetToken.sxyt.d.ts.map +0 -1
- package/dist/auth/ref/checkPasswordResetToken.sxyt.js +0 -40
- package/dist/auth/ref/createPasswordResetToken.sxyt.d.ts +0 -2
- package/dist/auth/ref/createPasswordResetToken.sxyt.d.ts.map +0 -1
- package/dist/auth/ref/createPasswordResetToken.sxyt.js +0 -10
- package/dist/babelPlugins/BabelAddDevCacheBust.sxyt.d.ts +0 -2
- package/dist/babelPlugins/BabelAddDevCacheBust.sxyt.d.ts.map +0 -1
- package/dist/babelPlugins/BabelAddDevCacheBust.sxyt.js +0 -138
- package/dist/babelPlugins/fixImportsInSassErrorMessage.sxyt.d.ts +0 -2
- package/dist/babelPlugins/fixImportsInSassErrorMessage.sxyt.d.ts.map +0 -1
- package/dist/babelPlugins/fixImportsInSassErrorMessage.sxyt.js +0 -108
- package/dist/babelPlugins/transformPackageImports/resolveBareImport.sxyt.d.ts +0 -2
- package/dist/babelPlugins/transformPackageImports/resolveBareImport.sxyt.d.ts.map +0 -1
- package/dist/babelPlugins/transformPackageImports/resolveBareImport.sxyt.js +0 -104
- package/dist/bin/commands/compile.sxyt.d.ts +0 -2
- package/dist/bin/commands/compile.sxyt.d.ts.map +0 -1
- package/dist/bin/commands/compile.sxyt.js +0 -255
- package/dist/build/modifySassImports.sxyt.d.ts +0 -2
- package/dist/build/modifySassImports.sxyt.d.ts.map +0 -1
- package/dist/build/modifySassImports.sxyt.js +0 -55
- package/dist/build/sassImportParser.sxyt.d.ts +0 -2
- package/dist/build/sassImportParser.sxyt.d.ts.map +0 -1
- package/dist/build/sassImportParser.sxyt.js +0 -110
- package/dist/build/scssImportParserChatgpt.sxyt.d.ts +0 -2
- package/dist/build/scssImportParserChatgpt.sxyt.d.ts.map +0 -1
- package/dist/build/scssImportParserChatgpt.sxyt.js +0 -120
- package/dist/clone.sxyt.d.ts +0 -2
- package/dist/clone.sxyt.d.ts.map +0 -1
- package/dist/clone.sxyt.js +0 -24
- package/dist/componentProxyHandlers.sxyt.d.ts +0 -2
- package/dist/componentProxyHandlers.sxyt.d.ts.map +0 -1
- package/dist/componentProxyHandlers.sxyt.js +0 -130
- package/dist/components/RawHtml.sxyt.d.ts +0 -2
- package/dist/components/RawHtml.sxyt.d.ts.map +0 -1
- package/dist/components/RawHtml.sxyt.js +0 -104
- package/dist/components/bindable/BindableSelect.sxyt.d.ts +0 -2
- package/dist/components/bindable/BindableSelect.sxyt.d.ts.map +0 -1
- package/dist/components/bindable/BindableSelect.sxyt.js +0 -186
- package/dist/env/injectEnv.sxyt.d.ts +0 -2
- package/dist/env/injectEnv.sxyt.d.ts.map +0 -1
- package/dist/env/injectEnv.sxyt.js +0 -20
- package/dist/env/parseEnv.d.ts +0 -2
- package/dist/env/parseEnv.d.ts.map +0 -1
- package/dist/env/parseEnv.js +0 -14
- package/dist/env/parseEnv.sxyt.d.ts +0 -2
- package/dist/env/parseEnv.sxyt.d.ts.map +0 -1
- package/dist/env/parseEnv.sxyt.js +0 -11
- package/dist/findProjectDir.sxyt.d.ts +0 -2
- package/dist/findProjectDir.sxyt.d.ts.map +0 -1
- package/dist/findProjectDir.sxyt.js +0 -82
- package/dist/hmr/applyHmrModule.sxyt.d.ts +0 -2
- package/dist/hmr/applyHmrModule.sxyt.d.ts.map +0 -1
- package/dist/hmr/applyHmrModule.sxyt.js +0 -182
- package/dist/hmr/instanceRegistry.sxyt.d.ts +0 -2
- package/dist/hmr/instanceRegistry.sxyt.d.ts.map +0 -1
- package/dist/hmr/instanceRegistry.sxyt.js +0 -24
- package/dist/hmr/refreshStylesheets.sxyt.d.ts +0 -2
- package/dist/hmr/refreshStylesheets.sxyt.d.ts.map +0 -1
- package/dist/hmr/refreshStylesheets.sxyt.js +0 -46
- package/dist/hydrate/hydrate.sxyt.d.ts +0 -2
- package/dist/hydrate/hydrate.sxyt.d.ts.map +0 -1
- package/dist/hydrate/hydrate.sxyt.js +0 -302
- package/dist/hydrate/reconcileHydratedAttributes.sxyt.d.ts +0 -2
- package/dist/hydrate/reconcileHydratedAttributes.sxyt.d.ts.map +0 -1
- package/dist/hydrate/reconcileHydratedAttributes.sxyt.js +0 -190
- package/dist/importDevModuleWithRetry.sxyt.d.ts +0 -2
- package/dist/importDevModuleWithRetry.sxyt.d.ts.map +0 -1
- package/dist/importDevModuleWithRetry.sxyt.js +0 -104
- package/dist/innerHtmlFromProps.sxyt.d.ts +0 -2
- package/dist/innerHtmlFromProps.sxyt.d.ts.map +0 -1
- package/dist/innerHtmlFromProps.sxyt.js +0 -99
- package/dist/postcssPlugins/parseSelectors.sxyt.d.ts +0 -2
- package/dist/postcssPlugins/parseSelectors.sxyt.d.ts.map +0 -1
- package/dist/postcssPlugins/parseSelectors.sxyt.js +0 -62
- package/dist/postcssPlugins/parseSelectorsRich.sxyt.d.ts +0 -2
- package/dist/postcssPlugins/parseSelectorsRich.sxyt.d.ts.map +0 -1
- package/dist/postcssPlugins/parseSelectorsRich.sxyt.js +0 -155
- package/dist/rawHtml/parseHtml.sxyt.d.ts +0 -2
- package/dist/rawHtml/parseHtml.sxyt.d.ts.map +0 -1
- package/dist/rawHtml/parseHtml.sxyt.js +0 -239
- package/dist/render/getFunctionBodyAsString.sxyt.d.ts +0 -2
- package/dist/render/getFunctionBodyAsString.sxyt.d.ts.map +0 -1
- package/dist/render/getFunctionBodyAsString.sxyt.js +0 -37
- package/dist/render/processHead.sxyt.d.ts +0 -2
- package/dist/render/processHead.sxyt.d.ts.map +0 -1
- package/dist/render/processHead.sxyt.js +0 -93
- package/dist/render/processProps.sxyt.d.ts +0 -2
- package/dist/render/processProps.sxyt.d.ts.map +0 -1
- package/dist/render/processProps.sxyt.js +0 -90
- package/dist/routing/compareRequestToRegex.sxyt.d.ts +0 -2
- package/dist/routing/compareRequestToRegex.sxyt.d.ts.map +0 -1
- package/dist/routing/compareRequestToRegex.sxyt.js +0 -65
- package/dist/routing/getPathPriority.sxyt.d.ts +0 -2
- package/dist/routing/getPathPriority.sxyt.d.ts.map +0 -1
- package/dist/routing/getPathPriority.sxyt.js +0 -24
- package/dist/routing/matchPath.sxyt.d.ts +0 -2
- package/dist/routing/matchPath.sxyt.d.ts.map +0 -1
- package/dist/routing/matchPath.sxyt.js +0 -41
- package/dist/routing/patternToRegex.sxyt.d.ts +0 -2
- package/dist/routing/patternToRegex.sxyt.d.ts.map +0 -1
- package/dist/routing/patternToRegex.sxyt.js +0 -69
- package/dist/routing/splitRequest.sxyt.d.ts +0 -2
- package/dist/routing/splitRequest.sxyt.d.ts.map +0 -1
- package/dist/routing/splitRequest.sxyt.js +0 -47
- package/dist/style/jssToCss.sxyt.d.ts +0 -2
- package/dist/style/jssToCss.sxyt.d.ts.map +0 -1
- package/dist/style/jssToCss.sxyt.js +0 -17
- package/dist/testing/createTestApp.sxyt.d.ts +0 -2
- package/dist/testing/createTestApp.sxyt.d.ts.map +0 -1
- package/dist/testing/createTestApp.sxyt.js +0 -470
- package/dist/testing/ensureTestEnvLoaded.sxyt.d.ts +0 -2
- package/dist/testing/ensureTestEnvLoaded.sxyt.d.ts.map +0 -1
- package/dist/testing/ensureTestEnvLoaded.sxyt.js +0 -20
- package/dist/update/hotSwap.sxyt.d.ts +0 -2
- package/dist/update/hotSwap.sxyt.d.ts.map +0 -1
- package/dist/update/hotSwap.sxyt.js +0 -252
package/dist/hydrate/hydrate.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { integrateElementUpdateVdom } from "../update/integrateUpdateVdom.js";
|
|
1
|
+
import { applyUpdate, integrateElementUpdateVdom } from "../update/integrateUpdateVdom.js";
|
|
2
2
|
//import type { RouteType } from '../routing/RouteType.js'
|
|
3
3
|
import { $number, $string, makeRenderedContentNodeNonRendered, makeRenderedContentNodeClassComponent, makeRenderedContentNodeFunctionComponent } from "../RenderedContentNode.js";
|
|
4
4
|
import { ContentNodeElementIsHtml, ContentNodeIsHtml, ContentNodeIsComponent, ContentNodeComponentIsClassComponent, ContentNodeIsElement } from "../ContentNode.js";
|
|
@@ -29,6 +29,7 @@ import { MatchedRoute } from "../routing/MatchedRoute.js";
|
|
|
29
29
|
import { isDev } from "../isDev.js";
|
|
30
30
|
import { warn } from "../appOutput.js";
|
|
31
31
|
import { reconcileHydratedAttributes } from "./reconcileHydratedAttributes.js";
|
|
32
|
+
import { renderHydrationMismatchBanner } from "./renderHydrationMismatchBanner.js";
|
|
32
33
|
import { setCurrentInstance } from "../hmr/instanceRegistry.js";
|
|
33
34
|
// side-effect only: pulls applyHmrModule.js (and its clean, non-dynamic-import dependencies)
|
|
34
35
|
// into the framework's traced dependency graph so it gets copied to .packages/ and is servable
|
|
@@ -39,12 +40,13 @@ import { setCurrentInstance } from "../hmr/instanceRegistry.js";
|
|
|
39
40
|
import "../hmr/applyHmrModule.js";
|
|
40
41
|
import { jsx as _jsx } from "tungsten/jsxRuntime.js";
|
|
41
42
|
function debug(...texts) {
|
|
42
|
-
console.log(...texts)
|
|
43
|
+
//console.log(...texts)
|
|
43
44
|
//console.log(getStackTrace().split('\n')[2])
|
|
44
45
|
}
|
|
45
46
|
function makeDefaultHydrateMeta() {
|
|
46
47
|
return {
|
|
47
|
-
insideForm: false
|
|
48
|
+
insideForm: false,
|
|
49
|
+
mismatches: []
|
|
48
50
|
};
|
|
49
51
|
} // can we opto this out in production?
|
|
50
52
|
export async function hydrate(appRoutes, RootComponent, instanceConfig) {
|
|
@@ -89,6 +91,7 @@ export async function hydrate(appRoutes, RootComponent, instanceConfig) {
|
|
|
89
91
|
// hydrateNode(content, null, domPointer, instance, meta)
|
|
90
92
|
}
|
|
91
93
|
instance.hydrationComplete = true;
|
|
94
|
+
if (isDev) renderHydrationMismatchBanner(meta.mismatches);
|
|
92
95
|
//// Can components update while hydrating is still taking place
|
|
93
96
|
//// -- probably yes
|
|
94
97
|
//// Can we pause any further update until hydration completes, to retain coherency?
|
|
@@ -114,12 +117,20 @@ routes) {
|
|
|
114
117
|
};
|
|
115
118
|
}
|
|
116
119
|
}
|
|
117
|
-
export async function hydrateRootComponent(instance, RootComponent, domPointer, meta
|
|
120
|
+
export async function hydrateRootComponent(instance, RootComponent, domPointer, meta,
|
|
121
|
+
// Real app hydration (hydrate(), above) always hydrates a root with no props of its own -
|
|
122
|
+
// route data comes through the store instead - so the default reproduces that. A test
|
|
123
|
+
// harness hydrating an arbitrary component (see testing/hydrateTestApp.ts) passes its own.
|
|
124
|
+
props = {},
|
|
125
|
+
// eslint-disable-line no-type-assertion/no-type-assertion -- default only reached when Props is empty, same as the hardcoded {} this replaces
|
|
126
|
+
routeParams, routeData) {
|
|
118
127
|
debug('hydrateRootComponent');
|
|
128
|
+
// matches createTungstenRootComponent's identical cast, the create-path equivalent of this function
|
|
129
|
+
// eslint-disable-next-line no-type-assertion/no-type-assertion
|
|
119
130
|
const element = new RootComponent({
|
|
120
|
-
props
|
|
121
|
-
routeParams
|
|
122
|
-
routeData
|
|
131
|
+
props,
|
|
132
|
+
routeParams,
|
|
133
|
+
routeData,
|
|
123
134
|
instance,
|
|
124
135
|
parentElement: null
|
|
125
136
|
});
|
|
@@ -489,7 +500,7 @@ async function hydrateNodeSingle(node, parentElement, domPointer, instance, meta
|
|
|
489
500
|
// node[$props].ref.current = domNode
|
|
490
501
|
// }
|
|
491
502
|
debug('hydarating atts');
|
|
492
|
-
hydrateAttributes(node, domNode);
|
|
503
|
+
hydrateAttributes(node, domNode, meta);
|
|
493
504
|
//!!! node.domElement = domNode
|
|
494
505
|
const props = node[$props];
|
|
495
506
|
if (node[$type] === 'textarea') {
|
|
@@ -525,7 +536,22 @@ async function hydrateNodeSingle(node, parentElement, domPointer, instance, meta
|
|
|
525
536
|
debug('valid children', validChildren(node[$props].children), node[$props].children);
|
|
526
537
|
const children = node[$props].children;
|
|
527
538
|
let renderedChildren = $contentNull;
|
|
528
|
-
if (node[$
|
|
539
|
+
if (node[$type] === 'body' && instance.config.csr) {
|
|
540
|
+
// CSR: body shipped empty on purpose, nothing to hydrate against - create fresh.
|
|
541
|
+
if (parentElement === null) {
|
|
542
|
+
throwError('hydrateNodeSingle', 'CSR hydration reached <body> with no owning component');
|
|
543
|
+
}
|
|
544
|
+
const childDomPointer = new DomPointer(domNode);
|
|
545
|
+
renderedChildren = await applyUpdate({
|
|
546
|
+
tungstenElement: parentElement,
|
|
547
|
+
instance,
|
|
548
|
+
newNode: children,
|
|
549
|
+
oldNode: $contentNull,
|
|
550
|
+
domRegion: null,
|
|
551
|
+
domPointer: childDomPointer,
|
|
552
|
+
parentNode: null
|
|
553
|
+
});
|
|
554
|
+
} else if (node[$props].__opaque !== true && validChildren(children)) {
|
|
529
555
|
debug('node.props.children', children);
|
|
530
556
|
const childDomPointer = new DomPointer(domNode);
|
|
531
557
|
renderedChildren = await hydrateNode(children, parentElement, childDomPointer, instance, meta);
|
|
@@ -570,17 +596,27 @@ async function hydrateNodeComponent(node, parentElement, domPointer, instance, m
|
|
|
570
596
|
}
|
|
571
597
|
// export type HTMLBindableElement = HTMLButtonElement | HTMLDataElement | HTMLInputElement | HTMLLIElement
|
|
572
598
|
// | HTMLMeterElement | HTMLOptionElement | HTMLParamElement | HTMLProgressElement | HTMLSelectElement | HTMLTextAreaElement
|
|
573
|
-
function hydrateAttributes(node, domNode) {
|
|
599
|
+
function hydrateAttributes(node, domNode, meta) {
|
|
574
600
|
// handle bind attributes and merge together event handlers
|
|
575
601
|
processAttributes(node);
|
|
576
602
|
// Bring the server's attributes into line with what this render produced.
|
|
577
603
|
// Runs in production as well as development: leaving a known-wrong value in
|
|
578
604
|
// place is not better in production, it is only quieter. Only genuine
|
|
579
605
|
// differences are written, so a page that matches costs reads and no
|
|
580
|
-
// writes.
|
|
581
|
-
//
|
|
606
|
+
// writes. Collection always runs (it is what a hydration-test harness reads
|
|
607
|
+
// to assert on - see testing/hydrateTestApp.ts); only the console report and
|
|
608
|
+
// the on-page banner (hydrate(), below) are dev-only, because a mismatch is
|
|
609
|
+
// a bug in the application's rendering rather than something a user can act on.
|
|
582
610
|
if (ContentNodeElementIsHtml(node)) {
|
|
583
|
-
reconcileHydratedAttributes(node, domNode,
|
|
611
|
+
reconcileHydratedAttributes(node, domNode, mismatch => {
|
|
612
|
+
meta.mismatches.push({
|
|
613
|
+
tagName: node[$type],
|
|
614
|
+
...mismatch
|
|
615
|
+
});
|
|
616
|
+
if (isDev) {
|
|
617
|
+
warn(`hydration mismatch on <${node[$type]}>:` + ` ${mismatch.name} rendered as ${JSON.stringify(mismatch.expected)}` + ` but the server sent ${JSON.stringify(mismatch.actual)}.` + ` The rendered value has been applied.`);
|
|
618
|
+
}
|
|
619
|
+
});
|
|
584
620
|
}
|
|
585
621
|
debug('--\nhydrateAttributes', domNode);
|
|
586
622
|
for (const key in node[$props]) {
|
|
@@ -698,6 +734,8 @@ function hydrateAttributes(node, domNode) {
|
|
|
698
734
|
function processAttributes(node) {
|
|
699
735
|
const props = node[$props];
|
|
700
736
|
debug('--\nprocessAttributes', node);
|
|
737
|
+
// set a button without specified type to button, so buttons don't submit forms unless instructed to
|
|
738
|
+
if (node[$type] === 'button' && !('type' in props)) props.type = 'button';
|
|
701
739
|
for (const key in node[$props]) {
|
|
702
740
|
if (key === 'bind' && ContentNodeElementIsHtml(node)) {
|
|
703
741
|
const eventName = 'onInput';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reconcileHydratedAttributes.d.ts","sourceRoot":"","sources":["../../src/hydrate/reconcileHydratedAttributes.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;
|
|
1
|
+
{"version":3,"file":"reconcileHydratedAttributes.d.ts","sourceRoot":"","sources":["../../src/hydrate/reconcileHydratedAttributes.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AAKxD,MAAM,MAAM,iBAAiB,GAAG;IAC5B,IAAI,EAAE,MAAM,CAAA;IACZ,gFAAgF;IAChF,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAA;IACvB,2EAA2E;IAC3E,MAAM,EAAE,MAAM,GAAG,IAAI,CAAA;CACxB,CAAA;AA6BD;;;;;;;;;;;;;GAaG;AACH,wBAAgB,2BAA2B,CACvC,IAAI,EAAE,eAAe,EACrB,OAAO,EAAE,WAAW,EACpB,UAAU,CAAC,EAAE,CAAC,QAAQ,EAAE,iBAAiB,KAAK,IAAI,GACnD,IAAI,CAuCN"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { $props } from "../contentNodeSymbols.js";
|
|
2
2
|
import { processProps } from "../render/processProps.js";
|
|
3
|
+
import { booleanAttributeValue } from "../booleanAttributeValue.js";
|
|
3
4
|
/**
|
|
4
5
|
* The attribute value a render produces for a prop, or null for "no attribute".
|
|
5
6
|
*
|
|
@@ -7,8 +8,8 @@ import { processProps } from "../render/processProps.js";
|
|
|
7
8
|
* the server and `addAttributes()` on the client — so that a value which
|
|
8
9
|
* round-trips unchanged compares equal here.
|
|
9
10
|
*/
|
|
10
|
-
function attributeValue(value) {
|
|
11
|
-
if (typeof value === 'boolean') return value
|
|
11
|
+
function attributeValue(name, value) {
|
|
12
|
+
if (typeof value === 'boolean') return booleanAttributeValue(name, value);
|
|
12
13
|
if (value === undefined || value === null) return null;
|
|
13
14
|
return String(value);
|
|
14
15
|
}
|
|
@@ -55,7 +56,7 @@ export function reconcileHydratedAttributes(node, domNode, onMismatch) {
|
|
|
55
56
|
const handled = new Set();
|
|
56
57
|
for (const name in expected) {
|
|
57
58
|
handled.add(name.toLowerCase());
|
|
58
|
-
const value = attributeValue(expected[name]);
|
|
59
|
+
const value = attributeValue(name, expected[name]);
|
|
59
60
|
const actual = domNode.getAttribute(name);
|
|
60
61
|
if (value === actual) continue;
|
|
61
62
|
if (value === null) removeAttribute(domNode, name);else setAttribute(domNode, name, value);
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { AttributeMismatch } from './reconcileHydratedAttributes.js';
|
|
2
|
+
export type TaggedAttributeMismatch = AttributeMismatch & {
|
|
3
|
+
tagName: string;
|
|
4
|
+
};
|
|
5
|
+
export declare const hydrationMismatchAttribute = "data-tungsten-hydration-mismatches";
|
|
6
|
+
export declare function renderHydrationMismatchBanner(mismatches: readonly TaggedAttributeMismatch[], doc?: Document): void;
|
|
7
|
+
//# sourceMappingURL=renderHydrationMismatchBanner.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"renderHydrationMismatchBanner.d.ts","sourceRoot":"","sources":["../../src/hydrate/renderHydrationMismatchBanner.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAA;AAEzE,MAAM,MAAM,uBAAuB,GAAG,iBAAiB,GAAG;IAAE,OAAO,EAAE,MAAM,CAAA;CAAE,CAAA;AAI7E,eAAO,MAAM,0BAA0B,uCAAuC,CAAA;AA2C9E,wBAAgB,6BAA6B,CACzC,UAAU,EAAE,SAAS,uBAAuB,EAAE,EAC9C,GAAG,GAAE,QAAmB,GACzB,IAAI,CA4BN"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
// Read by the CSS rule below via attr() - not by Tungsten. Exported so an
|
|
2
|
+
// application that wants different styling can target the same selector.
|
|
3
|
+
export const hydrationMismatchAttribute = 'data-tungsten-hydration-mismatches';
|
|
4
|
+
const styleId = 'tungsten-hydration-mismatches-style';
|
|
5
|
+
// Reports hydration mismatches in the page, not only the console, without
|
|
6
|
+
// adding a real DOM node to the hydrated tree.
|
|
7
|
+
//
|
|
8
|
+
// A real element - even one appended after hydration finishes and never
|
|
9
|
+
// touched again by this code - is not actually safe here. Every container
|
|
10
|
+
// Tungsten re-renders gets a fresh `new DomRegion(containerDomNode)` built
|
|
11
|
+
// from whatever is *actually* in its childNodes at that moment, and every
|
|
12
|
+
// position Tungsten writes to next is a raw index into that same list
|
|
13
|
+
// (DomPointer.get/next/prev, and several inline `childNodes[domPointer.index]`
|
|
14
|
+
// reads in integrateUpdateVdom.ts/hydrate.tsx). An extra, untracked child
|
|
15
|
+
// shifts every index after it, so the next update touching that container
|
|
16
|
+
// - body, in a typical app - would compare and write to the wrong nodes.
|
|
17
|
+
// There is no flag on an element that makes the walker skip it; it would
|
|
18
|
+
// have to be built into DomPointer/DomRegion and every direct childNodes
|
|
19
|
+
// access alongside them, which is a core-framework change, not a banner.
|
|
20
|
+
//
|
|
21
|
+
// Attributes are a different story: reconcileHydratedAttributes only runs
|
|
22
|
+
// once, during hydration, before this ever runs, and every later update
|
|
23
|
+
// (updateAttributes) diffs against domNode.__tungsten_oldAttributes - its
|
|
24
|
+
// own private record of what it last set - never the DOM's live attribute
|
|
25
|
+
// list. A plain setAttribute() here is in neither its old props nor its new
|
|
26
|
+
// props, so it is never visited, and never removed.
|
|
27
|
+
//
|
|
28
|
+
// So: set an attribute on <html> (outside Tungsten's own bookkeeping, so
|
|
29
|
+
// permanently untouched by it) and let a `content: attr(...)` pseudo-element
|
|
30
|
+
// display it. A pseudo-element is not a real node - never in .childNodes,
|
|
31
|
+
// never visited by DomPointer or DomRegion - so this carries zero index risk
|
|
32
|
+
// for the app's own reconciliation, at the cost of one small, deliberately
|
|
33
|
+
// hacky wrinkle: a single <style> tag inserted into <head> once.
|
|
34
|
+
//
|
|
35
|
+
// head is not structurally exempt from diffing in general - it currently
|
|
36
|
+
// just never gets diffed node-by-node during hydration (hydrateNodeSingle's
|
|
37
|
+
// 'head' case skips it outright, a known hack, not a guarantee), and nothing
|
|
38
|
+
// in a typical app changes head's vdom children after mount, so the general
|
|
39
|
+
// update path never exercises it either. That could change. What head does
|
|
40
|
+
// already have is a marker for exactly this situation - data--t-persist,
|
|
41
|
+
// used by processHead.ts for framework-injected head content (the entry
|
|
42
|
+
// script, the component CSS link) that isn't part of the app's own vdom and
|
|
43
|
+
// must survive hydration - so this style tag carries it too, rather than
|
|
44
|
+
// riding on the blanket skip alone.
|
|
45
|
+
export function renderHydrationMismatchBanner(mismatches, doc = document) {
|
|
46
|
+
if (mismatches.length === 0) return;
|
|
47
|
+
if (doc.getElementById(styleId) === null) {
|
|
48
|
+
const style = doc.createElement('style');
|
|
49
|
+
style.id = styleId;
|
|
50
|
+
style.setAttribute('data--t-persist', 'true');
|
|
51
|
+
style.textContent = `
|
|
52
|
+
html[${hydrationMismatchAttribute}]::before {
|
|
53
|
+
content: attr(${hydrationMismatchAttribute});
|
|
54
|
+
display: block;
|
|
55
|
+
background: #7a1f1f;
|
|
56
|
+
color: #fff;
|
|
57
|
+
font: 13px/1.5 monospace;
|
|
58
|
+
padding: 8px 12px;
|
|
59
|
+
max-height: 33vh;
|
|
60
|
+
overflow: auto;
|
|
61
|
+
white-space: pre-wrap;
|
|
62
|
+
}
|
|
63
|
+
`;
|
|
64
|
+
doc.head.appendChild(style);
|
|
65
|
+
}
|
|
66
|
+
const heading = `Tungsten: ${mismatches.length} hydration mismatch${mismatches.length === 1 ? '' : 'es'} (dev only)`;
|
|
67
|
+
const lines = mismatches.map(mismatch => `<${mismatch.tagName}> ${mismatch.name}: ` + `rendered ${JSON.stringify(mismatch.expected)}, server sent ${JSON.stringify(mismatch.actual)}`);
|
|
68
|
+
doc.documentElement.setAttribute(hydrationMismatchAttribute, [heading, ...lines].join('\n'));
|
|
69
|
+
}
|
package/dist/indexInner.d.ts
CHANGED
|
@@ -16,22 +16,26 @@ export * from './components/bindable/BindableTextarea.jsx';
|
|
|
16
16
|
export * from './components/GoToComponent.jsx';
|
|
17
17
|
export * from './components/Lazy.js';
|
|
18
18
|
export * from './components/Link.jsx';
|
|
19
|
+
export * from './components/PopMessages.jsx';
|
|
19
20
|
export * from './components/RawHtml.jsx';
|
|
20
21
|
export * from './components/RouteRedirectComponent.jsx';
|
|
21
22
|
export { parseHtml, type ParseHtmlOptions } from './rawHtml/parseHtml.js';
|
|
22
23
|
export { safeHtmlAllowList } from './rawHtml/safeHtmlAllowList.js';
|
|
23
24
|
export type { HtmlAllowList } from './rawHtml/HtmlAllowList.js';
|
|
25
|
+
export { sanitizeHtml, type SanitizeHtmlOptions } from './rawHtml/sanitizeHtml.js';
|
|
26
|
+
export { filterContentNode } from './rawHtml/filterContentNode.js';
|
|
27
|
+
export { contentNodeToHtml } from './render/contentNodeToHtml.js';
|
|
24
28
|
export * from './components/WebRedirectComponent.jsx';
|
|
25
|
-
export * from './nbsp.
|
|
29
|
+
export * from './nbsp.jsx';
|
|
30
|
+
export { pop, dismissPop } from './pop.js';
|
|
26
31
|
export * from './browserStorage.js';
|
|
27
32
|
export { createElement } from './createElement.js';
|
|
28
33
|
export * from './createRef.js';
|
|
29
34
|
export { foreach } from './foreach.js';
|
|
30
35
|
export * from './helpers/index.js';
|
|
31
36
|
export * from './hooks/index.js';
|
|
32
|
-
export * from './hydrate/hydrate.
|
|
37
|
+
export * from './hydrate/hydrate.jsx';
|
|
33
38
|
export * from './jsxRuntime.js';
|
|
34
|
-
export * from './env/parseEnv.js';
|
|
35
39
|
export * from './makeServerRpc.js';
|
|
36
40
|
export { isBrowser } from './isBrowser.js';
|
|
37
41
|
export { isClient } from './isClient.js';
|
|
@@ -41,10 +45,10 @@ export { isProd } from './isProd.js';
|
|
|
41
45
|
export { logAndReturn } from './logAndReturn.js';
|
|
42
46
|
export * from './requests/index.js';
|
|
43
47
|
export { registerGlobalData, type GlobalData, type GlobalDataFunction } from './routing/registerGlobalData.js';
|
|
44
|
-
export * from './routing/MatchedRoute.
|
|
48
|
+
export * from './routing/MatchedRoute.js';
|
|
45
49
|
export * from './routing/RedirectCode.js';
|
|
46
50
|
export * from './routing/Route.jsx';
|
|
47
|
-
export * from './routing/Router.
|
|
51
|
+
export * from './routing/Router.jsx';
|
|
48
52
|
export * from './routing/RouteContentFunction.js';
|
|
49
53
|
export * from './routing/RoutingRedirect.js';
|
|
50
54
|
export * from './routing/WebRedirect.js';
|
|
@@ -56,6 +60,7 @@ export * from './Store/registerStore.js';
|
|
|
56
60
|
export * from './components/Stylesheet.jsx';
|
|
57
61
|
export { TungstenError } from './TungstenError.js';
|
|
58
62
|
export * from './__deproxy.js';
|
|
63
|
+
export { $original } from './componentProxyHandlers.js';
|
|
59
64
|
export type { Request } from './api/Request.js';
|
|
60
65
|
export type { Response } from './api/Response.js';
|
|
61
66
|
export type { BindVariable, TypedBindVariable } from './components/bindable/BindVariable.js';
|
|
@@ -64,12 +69,15 @@ export * from './ContentNode.js';
|
|
|
64
69
|
export type { GenericObject } from './GenericObject.type.js';
|
|
65
70
|
export type { Instance } from './Instance/Instance.js';
|
|
66
71
|
export type { Key } from './Key.js';
|
|
72
|
+
export type { PopMessage } from './PopMessage.type.js';
|
|
67
73
|
export type { ReqRes, ReqResOrNull } from './ReqRes.js';
|
|
68
74
|
export type { Params } from './routing/Params.js';
|
|
69
75
|
export type { ParamsFromPath } from './routing/ParamsFromPath.js';
|
|
70
76
|
export type { RouteType, Route } from './routing/RouteType.js';
|
|
71
77
|
export { type RouteKey, type Path, type Path as RoutePath, StringIsPath, RouteKeyIsPath } from './routing/RouteTypes.js';
|
|
72
78
|
export type { Routes, CustomRoutes } from './routing/Routes.js';
|
|
79
|
+
export type { ErrorRouteType } from './routing/ErrorRouteType.js';
|
|
80
|
+
export { type TungstenErrorInfo, makeTungstenErrorInfo } from './routing/TungstenErrorInfo.js';
|
|
73
81
|
export type { RouteParams } from './routing/RouteParams.type.js';
|
|
74
82
|
export type { RouteData } from './routing/RouteData.js';
|
|
75
83
|
export type { RouteDataFunction } from './routing/RouteDataFunction.type.js';
|
package/dist/indexInner.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"indexInner.d.ts","sourceRoot":"","sources":["../src/indexInner.ts"],"names":[],"mappings":"AAEA,cAAc,qBAAqB,CAAA;AACnC,OAAO,EACH,uBAAuB,EAAE,uBAAuB,IAAI,eAAe,EAAE,mBAAmB;AACxF,yBAAyB,EAAE,yBAAyB,IAAI,iBAAiB,EAAE,qBAAqB;AAEhG,gCAAgC,EAAE,gCAAgC,IAAI,wBAAwB,EAC9F,kCAAkC,EAAE,kCAAkC,IAAI,0BAA0B,GACvG,MAAM,kBAAkB,CAAA;AAEzB,cAAc,YAAY,CAAA;AAC1B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,oBAAoB,CAAA;AAClC,cAAc,YAAY,CAAA;AAC1B,cAAc,uBAAuB,CAAA;AACrC,cAAc,4CAA4C,CAAA;AAC1D,cAAc,yCAAyC,CAAA;AACvD,cAAc,8CAA8C,CAAA;AAC5D,cAAc,yCAAyC,CAAA;AACvD,cAAc,0CAA0C,CAAA;AACxD,cAAc,4CAA4C,CAAA;AAC1D,cAAc,gCAAgC,CAAA;AAC9C,cAAc,sBAAsB,CAAA;AACpC,cAAc,uBAAuB,CAAA;AACrC,cAAc,0BAA0B,CAAA;AACxC,cAAc,yCAAyC,CAAA;AACvD,OAAO,EAAE,SAAS,EAAE,KAAK,gBAAgB,EAAE,MAAM,wBAAwB,CAAA;AACzE,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AAClE,YAAY,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAA;AAC/D,cAAc,uCAAuC,CAAA;AACrD,cAAc,
|
|
1
|
+
{"version":3,"file":"indexInner.d.ts","sourceRoot":"","sources":["../src/indexInner.ts"],"names":[],"mappings":"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"}
|
package/dist/indexInner.js
CHANGED
|
@@ -21,12 +21,17 @@ export * from "./components/bindable/BindableTextarea.js";
|
|
|
21
21
|
export * from "./components/GoToComponent.js";
|
|
22
22
|
export * from "./components/Lazy.js";
|
|
23
23
|
export * from "./components/Link.js";
|
|
24
|
+
export * from "./components/PopMessages.js";
|
|
24
25
|
export * from "./components/RawHtml.js";
|
|
25
26
|
export * from "./components/RouteRedirectComponent.js";
|
|
26
27
|
export { parseHtml } from "./rawHtml/parseHtml.js";
|
|
27
28
|
export { safeHtmlAllowList } from "./rawHtml/safeHtmlAllowList.js";
|
|
29
|
+
export { sanitizeHtml } from "./rawHtml/sanitizeHtml.js";
|
|
30
|
+
export { filterContentNode } from "./rawHtml/filterContentNode.js";
|
|
31
|
+
export { contentNodeToHtml } from "./render/contentNodeToHtml.js";
|
|
28
32
|
export * from "./components/WebRedirectComponent.js";
|
|
29
33
|
export * from "./nbsp.js";
|
|
34
|
+
export { pop, dismissPop } from "./pop.js";
|
|
30
35
|
export * from "./browserStorage.js";
|
|
31
36
|
export { createElement } from "./createElement.js";
|
|
32
37
|
export * from "./createRef.js";
|
|
@@ -38,7 +43,7 @@ export * from "./hooks/index.js";
|
|
|
38
43
|
export * from "./hydrate/hydrate.js";
|
|
39
44
|
export * from "./jsxRuntime.js";
|
|
40
45
|
//export { tungstenPrivateEnv, tungstenPublicEnv } from './env/env.js'
|
|
41
|
-
export * from
|
|
46
|
+
//export * from './env/parseEnv.js'
|
|
42
47
|
export * from "./makeServerRpc.js";
|
|
43
48
|
export { isBrowser } from "./isBrowser.js";
|
|
44
49
|
export { isClient } from "./isClient.js";
|
|
@@ -65,5 +70,7 @@ export * from "./Store/registerStore.js";
|
|
|
65
70
|
export * from "./components/Stylesheet.js";
|
|
66
71
|
export { TungstenError } from "./TungstenError.js";
|
|
67
72
|
export * from "./__deproxy.js";
|
|
73
|
+
export { $original } from "./componentProxyHandlers.js";
|
|
68
74
|
export * from "./ContentNode.js"; // types and type guards
|
|
69
|
-
export { StringIsPath, RouteKeyIsPath } from "./routing/RouteTypes.js";
|
|
75
|
+
export { StringIsPath, RouteKeyIsPath } from "./routing/RouteTypes.js";
|
|
76
|
+
export { makeTungstenErrorInfo } from "./routing/TungstenErrorInfo.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"makeInstanceConfigFromFrameworkConfig.d.ts","sourceRoot":"","sources":["../src/makeInstanceConfigFromFrameworkConfig.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAA;AAClE,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAA;AAEnE,wBAAgB,qCAAqC,CACjD,eAAe,EAAE,uBAAuB,EAAE,GAAG,GAAE,OAAe,GAC/D,cAAc,
|
|
1
|
+
{"version":3,"file":"makeInstanceConfigFromFrameworkConfig.d.ts","sourceRoot":"","sources":["../src/makeInstanceConfigFromFrameworkConfig.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAA;AAClE,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAA;AAEnE,wBAAgB,qCAAqC,CACjD,eAAe,EAAE,uBAAuB,EAAE,GAAG,GAAE,OAAe,GAC/D,cAAc,CAWhB"}
|
|
@@ -5,7 +5,8 @@ export function makeInstanceConfigFromFrameworkConfig(frameworkConfig, dev = fal
|
|
|
5
5
|
useRootComponent: frameworkConfig.useRootComponent,
|
|
6
6
|
clientSideNav: frameworkConfig.clientSideNav,
|
|
7
7
|
siteBasePath: dev ? '' : frameworkConfig.siteBasePath,
|
|
8
|
-
staticSite: frameworkConfig.staticSite
|
|
8
|
+
staticSite: frameworkConfig.staticSite,
|
|
9
|
+
csr: frameworkConfig.csr
|
|
9
10
|
};
|
|
10
11
|
if ('sourceDir' in frameworkConfig) c.sourceDir = frameworkConfig.sourceDir;
|
|
11
12
|
return c;
|
package/dist/pop.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Instance } from './Instance/Instance.js';
|
|
2
|
+
export declare function registerPopInstance(newInstance: Instance): void;
|
|
3
|
+
export declare function dismissPop(id: number): void;
|
|
4
|
+
export declare function pop(text: string): void;
|
|
5
|
+
type PopFunction = typeof pop;
|
|
6
|
+
declare global {
|
|
7
|
+
var pop: PopFunction;
|
|
8
|
+
}
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=pop.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pop.d.ts","sourceRoot":"","sources":["../src/pop.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAA;AAStD,wBAAgB,mBAAmB,CAAC,WAAW,EAAE,QAAQ,GAAG,IAAI,CAE/D;AAQD,wBAAgB,UAAU,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,CAO3C;AAID,wBAAgB,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAatC;AAMD,KAAK,WAAW,GAAG,OAAO,GAAG,CAAA;AAE7B,OAAO,CAAC,MAAM,CAAC;IAEX,IAAI,GAAG,EAAE,WAAW,CAAA;CACvB"}
|
package/dist/pop.js
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { isServer } from "./isServer.js";
|
|
2
|
+
import { log, warn } from "./appOutput.js";
|
|
3
|
+
// Set once by PopMessages.clientInit, from this.__instance - one Instance per app, shared
|
|
4
|
+
// across the whole client lifetime, so no per-component proxy/subscription is needed here.
|
|
5
|
+
let instance = null;
|
|
6
|
+
export function registerPopInstance(newInstance) {
|
|
7
|
+
instance = newInstance;
|
|
8
|
+
}
|
|
9
|
+
let nextId = 0;
|
|
10
|
+
const AUTO_DISMISS_MS = 3000;
|
|
11
|
+
const LEAVE_MS = 200; // match .pop-message.leaving's transition duration in PopMessages.tsx
|
|
12
|
+
// Shared by pop()'s auto-dismiss and PopMessages' click-to-dismiss, so both leave the same way.
|
|
13
|
+
export function dismissPop(id) {
|
|
14
|
+
if (instance === null) return;
|
|
15
|
+
const {
|
|
16
|
+
popMessages
|
|
17
|
+
} = instance.internalStore;
|
|
18
|
+
popMessages.set(popMessages.get().map(message => message.id === id ? {
|
|
19
|
+
...message,
|
|
20
|
+
leaving: true
|
|
21
|
+
} : message));
|
|
22
|
+
setTimeout(() => {
|
|
23
|
+
popMessages.set(popMessages.get().filter(message => message.id !== id));
|
|
24
|
+
}, LEAVE_MS);
|
|
25
|
+
}
|
|
26
|
+
// Shows a dismissible banner via <PopMessages/> (an app mounts one in its Root). Also available
|
|
27
|
+
// as global.pop / window.pop for ad-hoc use outside component code, on server and client alike.
|
|
28
|
+
export function pop(text) {
|
|
29
|
+
if (isServer) {
|
|
30
|
+
log('pop: ' + text);
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
if (instance === null) {
|
|
34
|
+
warn('pop() called before the app finished mounting; message dropped:', text);
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
const message = {
|
|
38
|
+
id: nextId++,
|
|
39
|
+
text
|
|
40
|
+
};
|
|
41
|
+
const {
|
|
42
|
+
popMessages
|
|
43
|
+
} = instance.internalStore;
|
|
44
|
+
popMessages.set([...popMessages.get(), message]);
|
|
45
|
+
setTimeout(() => dismissPop(message.id), AUTO_DISMISS_MS);
|
|
46
|
+
}
|
|
47
|
+
// Assigned at module load in both environments, so a pre-mount browser call hits pop()'s
|
|
48
|
+
// no-bridge branch instead of throwing.
|
|
49
|
+
globalThis.pop = pop;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TransformCssNames.d.ts","sourceRoot":"","sources":["../../src/postcssPlugins/TransformCssNames.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,IAAI,EAAQ,MAAM,SAAS,CAAA;AACzC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;
|
|
1
|
+
{"version":3,"file":"TransformCssNames.d.ts","sourceRoot":"","sources":["../../src/postcssPlugins/TransformCssNames.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,IAAI,EAAQ,MAAM,SAAS,CAAA;AACzC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AAkE9C,KAAK,IAAI,GAAG;IACR,UAAU,EAAE,MAAM,CAAA;IAClB,QAAQ,EAAE,QAAQ,CAAA;CACrB,CAAA;AAKD,eAAO,MAAM,iBAAiB;WAAU,IAAI;;mBAezB,IAAI;;;CAoHtB,CAAA"}
|
|
@@ -36,9 +36,17 @@ function transformClass(moduleName, className) {
|
|
|
36
36
|
}
|
|
37
37
|
const escapedHash = '\\0023';
|
|
38
38
|
//const escapedDollar = '\\0024'
|
|
39
|
+
// A module name may carry a `#` marking it as framework-owned rather than
|
|
40
|
+
// app-owned (see modulePrefix). `#` cannot appear raw in a selector, so the CSS
|
|
41
|
+
// side takes the escaped form while the JS side keeps the literal one that goes
|
|
42
|
+
// into the DOM class attribute. The 4-digit escape needs a non-hex character
|
|
43
|
+
// after it to terminate, which the prefix's trailing `-` provides.
|
|
44
|
+
function escapeModuleName(moduleName) {
|
|
45
|
+
return moduleName.replaceAll('#', escapedHash);
|
|
46
|
+
}
|
|
39
47
|
function transformTag(moduleName, tag) {
|
|
40
48
|
return {
|
|
41
|
-
css: moduleName + '_' + escapedHash + '_' + tag,
|
|
49
|
+
css: escapeModuleName(moduleName) + '_' + escapedHash + '_' + tag,
|
|
42
50
|
jsx: moduleName + '_#_' + tag
|
|
43
51
|
};
|
|
44
52
|
}
|
|
@@ -94,7 +102,7 @@ export const TransformCssNames = opts => {
|
|
|
94
102
|
} else if (type === 'class') {
|
|
95
103
|
const className = content.slice(1);
|
|
96
104
|
const newClassName = transformClass(moduleName, className);
|
|
97
|
-
newSelectors.push('.' +
|
|
105
|
+
newSelectors.push('.' + transformClass(escapeModuleName(moduleName), className));
|
|
98
106
|
names.classes[className] = newClassName;
|
|
99
107
|
} else if (type === 'tag') {
|
|
100
108
|
const newName = transformTag(moduleName, content);
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `since` is the tick at which the receiving component last rendered. It is only consulted
|
|
3
|
+
* when the two sides are the same object, which is where a structural comparison cannot
|
|
4
|
+
* help: deep state is mutated in place, so both sides are the already-mutated object.
|
|
5
|
+
*/
|
|
6
|
+
export declare function valuesAreEqual(a: unknown, b: unknown, since?: number): boolean;
|
|
7
|
+
export declare function propsAreEqual(previous: unknown, next: unknown, since?: number): boolean;
|
|
8
|
+
//# sourceMappingURL=propsAreEqual.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"propsAreEqual.d.ts","sourceRoot":"","sources":["../src/propsAreEqual.ts"],"names":[],"mappings":"AA+DA;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,OAAO,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAwC9E;AAED,wBAAgB,aAAa,CAAC,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAEvF"}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { objectTypesToProxy } from "./objectTypesToProxy.js";
|
|
2
|
+
import { changedAt } from "./stateTracking.js";
|
|
3
|
+
/**
|
|
4
|
+
* Structural comparison of component props, used to skip updating a child whose
|
|
5
|
+
* props have not changed.
|
|
6
|
+
*
|
|
7
|
+
* Follows the same reachability rule as the state proxy (see componentProxyHandlers):
|
|
8
|
+
* arrays and plain objects are data holders and are traversed; anything built from
|
|
9
|
+
* another constructor is an integral entity and is compared by identity. That keeps
|
|
10
|
+
* `state.form.x` style deep props working without walking into class instances.
|
|
11
|
+
*
|
|
12
|
+
* Reference identity short-circuits, so an unchanged array prop costs one comparison
|
|
13
|
+
* regardless of its length.
|
|
14
|
+
*/
|
|
15
|
+
function constructorNameOf(value) {
|
|
16
|
+
const proto = Object.getPrototypeOf(value);
|
|
17
|
+
if (proto === null || proto === undefined) return undefined;
|
|
18
|
+
const ctor = Reflect.get(proto, 'constructor');
|
|
19
|
+
if (typeof ctor !== 'function') return undefined;
|
|
20
|
+
return ctor.name;
|
|
21
|
+
}
|
|
22
|
+
/** treated as a data holder, and therefore traversed rather than compared by identity */
|
|
23
|
+
function isTraversable(value) {
|
|
24
|
+
const name = constructorNameOf(value);
|
|
25
|
+
return name !== undefined && objectTypesToProxy.includes(name);
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Has anything inside this object been mutated since the given tick?
|
|
29
|
+
*
|
|
30
|
+
* Walks down through data holders only, exactly as the comparison does, and stops at the
|
|
31
|
+
* first stamp newer than `since`. Cycles are possible in user state, so visited objects
|
|
32
|
+
* are tracked.
|
|
33
|
+
*/
|
|
34
|
+
function hasChangedSince(value, since, seen) {
|
|
35
|
+
if (seen.has(value)) return false;
|
|
36
|
+
seen.add(value);
|
|
37
|
+
// read through the proxy: $changed lives on the object and every get trap forwards
|
|
38
|
+
// unrecognised symbol keys to its target, so this works proxied or not
|
|
39
|
+
if (changedAt(value) > since) return true;
|
|
40
|
+
const raw = value;
|
|
41
|
+
if (Array.isArray(raw)) {
|
|
42
|
+
for (const entry of raw) {
|
|
43
|
+
if (typeof entry === 'object' && entry !== null && hasChangedSince(entry, since, seen)) return true;
|
|
44
|
+
}
|
|
45
|
+
return false;
|
|
46
|
+
}
|
|
47
|
+
if (!isTraversable(raw)) return false; // integral entity: its internals are not our business
|
|
48
|
+
for (const key of Object.keys(raw)) {
|
|
49
|
+
const entry = Reflect.get(raw, key);
|
|
50
|
+
if (typeof entry === 'object' && entry !== null && hasChangedSince(entry, since, seen)) return true;
|
|
51
|
+
}
|
|
52
|
+
return false;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* `since` is the tick at which the receiving component last rendered. It is only consulted
|
|
56
|
+
* when the two sides are the same object, which is where a structural comparison cannot
|
|
57
|
+
* help: deep state is mutated in place, so both sides are the already-mutated object.
|
|
58
|
+
*/
|
|
59
|
+
export function valuesAreEqual(a, b, since) {
|
|
60
|
+
if (a === b) {
|
|
61
|
+
// primitives cannot have been mutated behind our back
|
|
62
|
+
if (typeof a !== 'object' || a === null) return true;
|
|
63
|
+
// no render baseline means we cannot prove the object is unchanged, and deep state
|
|
64
|
+
// is mutated in place -- so assume it changed rather than silently skipping
|
|
65
|
+
if (since === undefined) return false;
|
|
66
|
+
return !hasChangedSince(a, since, new Set());
|
|
67
|
+
}
|
|
68
|
+
// TODO: compare functions by source (String(fn)), so an inline handler recreated
|
|
69
|
+
// on each render does not by itself force a child to re-render. Left as identity
|
|
70
|
+
// for now because source equality ignores captured variables: two closures written
|
|
71
|
+
// identically but capturing different values would compare equal, and a child whose
|
|
72
|
+
// only differing prop is such a closure would be skipped and keep the old binding.
|
|
73
|
+
// Memoize String(fn) per function object if this is implemented -- it allocates.
|
|
74
|
+
if (typeof a === 'function' || typeof b === 'function') return false;
|
|
75
|
+
if (typeof a !== 'object' || typeof b !== 'object' || a === null || b === null) return false;
|
|
76
|
+
if (Array.isArray(a) || Array.isArray(b)) {
|
|
77
|
+
if (!Array.isArray(a) || !Array.isArray(b) || a.length !== b.length) return false;
|
|
78
|
+
for (let i = 0; i < a.length; i++) {
|
|
79
|
+
if (!valuesAreEqual(a[i], b[i], since)) return false;
|
|
80
|
+
}
|
|
81
|
+
return true;
|
|
82
|
+
}
|
|
83
|
+
// class instances are integral entities: not equal unless the same object,
|
|
84
|
+
// which `a === b` above already covered
|
|
85
|
+
if (!isTraversable(a) || !isTraversable(b)) return false;
|
|
86
|
+
const aKeys = Object.keys(a);
|
|
87
|
+
const bKeys = Object.keys(b);
|
|
88
|
+
if (aKeys.length !== bKeys.length) return false;
|
|
89
|
+
for (const key of aKeys) {
|
|
90
|
+
if (!Object.prototype.hasOwnProperty.call(b, key)) return false;
|
|
91
|
+
if (!valuesAreEqual(Reflect.get(a, key), Reflect.get(b, key), since)) return false;
|
|
92
|
+
}
|
|
93
|
+
return true;
|
|
94
|
+
}
|
|
95
|
+
export function propsAreEqual(previous, next, since) {
|
|
96
|
+
return valuesAreEqual(previous, next, since);
|
|
97
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { ContentNode } from '../ContentNode.js';
|
|
2
|
+
import type { HtmlAllowList } from './HtmlAllowList.js';
|
|
3
|
+
/**
|
|
4
|
+
* Applies an allow list to a content tree that already exists, rather than
|
|
5
|
+
* one being built - the same decisions `parseHtml(html, { allowList })` makes
|
|
6
|
+
* while parsing, for a tree that did not come from parsing HTML at all (one
|
|
7
|
+
* rebuilt from storage, for instance) and so never had the chance to.
|
|
8
|
+
*
|
|
9
|
+
* A disallowed element is unwrapped, keeping its children in its place, so
|
|
10
|
+
* filtering a tag never costs the reader the words inside it - the same rule
|
|
11
|
+
* `parseHtml` applies. An element holding program text rather than prose
|
|
12
|
+
* (`<script>`, and anything on the same footing as `<script>` even under a
|
|
13
|
+
* permissive allow list) is dropped whole instead. `on*` props, `ref`, and
|
|
14
|
+
* `dangerouslySetInnerHTML` are always stripped - the tree-shape equivalent
|
|
15
|
+
* of what `parseHtml` refuses to produce in the first place - and a `href`/
|
|
16
|
+
* `src`/... value using an executable scheme (`javascript:`, `vbscript:`) or,
|
|
17
|
+
* on a navigating attribute, `data:` is dropped the same way.
|
|
18
|
+
*/
|
|
19
|
+
export declare function filterContentNode(node: ContentNode, allowList: HtmlAllowList): ContentNode;
|
|
20
|
+
//# sourceMappingURL=filterContentNode.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"filterContentNode.d.ts","sourceRoot":"","sources":["../../src/rawHtml/filterContentNode.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAa,MAAM,mBAAmB,CAAA;AAI/D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAyFvD;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,WAAW,EAAE,SAAS,EAAE,aAAa,GAAG,WAAW,CAE1F"}
|