@oracle/oraclejet-audit 10.1.0 → 12.0.0
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/LICENSE.md +1 -1
- package/jaf-amd.js +12 -4
- package/jaf.js +6 -1
- package/jafapi.js +6 -1
- package/lib/AST.js +6 -1
- package/lib/AST_Ts.js +6 -1
- package/lib/AstJson.js +6 -1
- package/lib/AstMd.js +6 -0
- package/lib/AstNodeTypes.js +6 -1
- package/lib/Comments.js +6 -1
- package/lib/ComponentSvcs.js +5 -0
- package/lib/Components.js +6 -1
- package/lib/Config.js +6 -1
- package/lib/ConfigLib.js +6 -1
- package/lib/CssLib.js +5 -0
- package/lib/CssUtils.js +5 -0
- package/lib/DomUtils.js +6 -1
- package/lib/FileIndex.js +5 -0
- package/lib/FileSet.js +5 -0
- package/lib/FsUtils.js +6 -1
- package/lib/Histo.js +6 -0
- package/lib/HtmlTree.js +6 -1
- package/lib/HtmlUtils.js +5 -0
- package/lib/Issue.js +6 -1
- package/lib/JafEvents.js +5 -0
- package/lib/JafLib.js +6 -1
- package/lib/Json.js +6 -0
- package/lib/JsonLoader.js +6 -1
- package/lib/Md.js +6 -0
- package/lib/MetaLib.js +6 -1
- package/lib/NetUtils.js +5 -0
- package/lib/NodeTypes.js +5 -0
- package/lib/Parser.js +6 -1
- package/lib/RegTypes.js +6 -1
- package/lib/Registry.js +6 -1
- package/lib/Reporter.js +6 -1
- package/lib/RuleContext.js +5 -0
- package/lib/RulePack.js +5 -0
- package/lib/RuleSet.js +6 -1
- package/lib/Rules.js +6 -1
- package/lib/Scope.js +6 -1
- package/lib/SemVer.js +5 -0
- package/lib/Server.js +5 -0
- package/lib/SevLib.js +5 -0
- package/lib/Severity.js +6 -1
- package/lib/Stats.js +6 -0
- package/lib/Ts.js +6 -1
- package/lib/Utils.js +6 -1
- package/lib/Watch.js +5 -0
- package/lib/Writer.js +5 -0
- package/lib/ZipUtils.js +5 -0
- package/lib/api.js +6 -0
- package/lib/builtinpacks.js +6 -0
- package/lib/cliStats.js +6 -0
- package/lib/clone.js +6 -1
- package/lib/cmdline.js +6 -1
- package/lib/colors.js +6 -1
- package/lib/defaults.js +6 -0
- package/lib/deflist.js +6 -0
- package/lib/dislist.js +6 -0
- package/lib/exportRules.js +6 -0
- package/lib/extends.js +6 -0
- package/lib/filetypes.js +6 -0
- package/lib/grouplist.js +6 -0
- package/lib/groups.js +6 -0
- package/lib/help.js +6 -1
- package/lib/jetver.js +6 -1
- package/lib/macros.js +6 -0
- package/lib/manual.js +6 -1
- package/lib/metaLoader.js +5 -0
- package/lib/metahist.js +5 -0
- package/lib/msgidLoader.js +6 -1
- package/lib/ns.js +6 -1
- package/lib/nslist.js +5 -0
- package/lib/outFormat.js +6 -0
- package/lib/outfile.js +5 -0
- package/lib/ruleLoader.js +5 -0
- package/lib/scaffold.js +6 -1
- package/lib/scaffoldRule.js +6 -1
- package/lib/schema.js +6 -1
- package/lib/scopewalker.js +6 -0
- package/lib/spinner.js +6 -1
- package/lib/spinnernoop.js +5 -0
- package/lib/tabs.js +5 -0
- package/libext/expparser.js +6 -1
- package/meta/11.0.0/jetauditmeta.js +9 -0
- package/meta/11.1.0/jetauditmeta.js +9 -0
- package/meta/12.0.0/jetauditmeta.js +9 -0
- package/meta/metaverlist.json +1 -1
- package/package.json +72 -69
- package/rulepacks/csp/csp-html-script-unsafe-inline.js +5 -0
- package/rulepacks/csp/csp-html-style-unsafe-inline.js +5 -0
- package/rulepacks/csp/csp-html-unsafe-expr.js +5 -0
- package/rulepacks/csp/csp-js-script-unsafe-eval.js +6 -1
- package/rulepacks/csp/csp-js-style-unsafe-inline.js +5 -0
- package/rulepacks/csp/csp-ts-script-unsafe-eval.js +6 -0
- package/rulepacks/csp/csp-ts-style-unsafe-inline.js +6 -0
- package/rulepacks/csp/msgid.json +6 -1
- package/rulepacks/csp/rules.json +6 -1
- package/rulepacks/jetwc/jetwc-absolute-jetversion.js +6 -1
- package/rulepacks/jetwc/jetwc-aria-redefinition.js +6 -1
- package/rulepacks/jetwc/jetwc-bootstrap.js +6 -1
- package/rulepacks/jetwc/jetwc-compjson-bp-ar.js +6 -1
- package/rulepacks/jetwc/jetwc-compjson-bp-obj.js +6 -1
- package/rulepacks/jetwc/jetwc-component-dependencies.js +6 -1
- package/rulepacks/jetwc/jetwc-component-displayname.js +6 -1
- package/rulepacks/jetwc/jetwc-component-foldername.js +6 -1
- package/rulepacks/jetwc/jetwc-component-location.js +6 -1
- package/rulepacks/jetwc/jetwc-component-type.js +6 -1
- package/rulepacks/jetwc/jetwc-css-oj-complete.js +6 -0
- package/rulepacks/jetwc/jetwc-data-property-prefix.js +6 -1
- package/rulepacks/jetwc/jetwc-deprecated-lifecycle.js +6 -1
- package/rulepacks/jetwc/jetwc-disabled-property.js +6 -1
- package/rulepacks/jetwc/jetwc-displayname.js +6 -1
- package/rulepacks/jetwc/jetwc-dynamic-slot-context.js +6 -1
- package/rulepacks/jetwc/jetwc-dynamic-slots-naming.js +6 -1
- package/rulepacks/jetwc/jetwc-event-displayname.js +6 -1
- package/rulepacks/jetwc/jetwc-events.js +6 -1
- package/rulepacks/jetwc/jetwc-jet-version.js +6 -1
- package/rulepacks/jetwc/jetwc-loader-file.js +6 -1
- package/rulepacks/jetwc/jetwc-markdown-link.js +6 -0
- package/rulepacks/jetwc/jetwc-method-displayname.js +6 -1
- package/rulepacks/jetwc/jetwc-methods.js +6 -1
- package/rulepacks/jetwc/jetwc-namespace.js +6 -1
- package/rulepacks/jetwc/jetwc-nested-defaults.js +6 -1
- package/rulepacks/jetwc/jetwc-nls-languages.js +6 -1
- package/rulepacks/jetwc/jetwc-nls-root.js +6 -1
- package/rulepacks/jetwc/jetwc-oj-register.js +6 -1
- package/rulepacks/jetwc/jetwc-ojcss.js +6 -1
- package/rulepacks/jetwc/jetwc-pack-children.js +6 -1
- package/rulepacks/jetwc/jetwc-packable-components.js +6 -1
- package/rulepacks/jetwc/jetwc-prerelease-dependencies.js +6 -1
- package/rulepacks/jetwc/jetwc-prerelease-pattern.js +6 -1
- package/rulepacks/jetwc/jetwc-prerelease-version.js +6 -1
- package/rulepacks/jetwc/jetwc-property-changed.js +6 -1
- package/rulepacks/jetwc/jetwc-property-displayname.js +6 -1
- package/rulepacks/jetwc/jetwc-property-nesting.js +6 -1
- package/rulepacks/jetwc/jetwc-public-modules.js +6 -1
- package/rulepacks/jetwc/jetwc-register-css.js +6 -1
- package/rulepacks/jetwc/jetwc-register-with-promises.js +6 -1
- package/rulepacks/jetwc/jetwc-require-paths.js +6 -1
- package/rulepacks/jetwc/jetwc-required-subproperty.js +6 -0
- package/rulepacks/jetwc/jetwc-reserved-property.js +6 -1
- package/rulepacks/jetwc/jetwc-schema.js +6 -1
- package/rulepacks/jetwc/jetwc-semantic-version.js +6 -1
- package/rulepacks/jetwc/jetwc-slot-displayname.js +6 -1
- package/rulepacks/jetwc/jetwc-slots.js +6 -1
- package/rulepacks/jetwc/jetwc-standard-files.js +6 -1
- package/rulepacks/jetwc/jetwc-subproperty-writeback.js +6 -0
- package/rulepacks/jetwc/jetwc-template-slots.js +6 -1
- package/rulepacks/jetwc/jetwc-unused-events.js +6 -1
- package/rulepacks/jetwc/jetwc-unused-slots.js +6 -1
- package/rulepacks/jetwc/jetwc-vb-category.js +6 -1
- package/rulepacks/jetwc/jetwc-vb-icon.js +6 -1
- package/rulepacks/jetwc/jetwc-vcomponent-jetversion.js +6 -0
- package/rulepacks/jetwc/jetwc-vcomponent-loader.js +6 -0
- package/rulepacks/jetwc/jetwc-vcomponent-version.js +6 -0
- package/rulepacks/jetwc/jetwc-version-openrange.js +6 -1
- package/rulepacks/jetwc/jetwc-writeback-required.js +6 -1
- package/rulepacks/jetwc/msgid.json +6 -0
- package/rulepacks/jetwc/rules.json +6 -1
- package/rulepacks/jetwc-lib/jetwcutils-auditComponentCacheManager.js +6 -0
- package/rulepacks/jetwc-lib/jetwcutils-commonListenerImpls.js +6 -0
- package/rulepacks/jetwc-lib/jetwcutils-componentAuditUtils.js +6 -0
- package/rulepacks/jetwc-lib/jetwcutils-componentFinder.js +6 -0
- package/rulepacks/jetwc-lib/jetwcutils-preCompiler.js +6 -0
- package/rulepacks/jetwc-lib/jetwcutils-tsxUtils.js +6 -0
- package/rulepacks/jetwco/jetwco-bootstrap.js +6 -1
- package/rulepacks/jetwco/jetwco-cacc-auditConstraints.js +6 -0
- package/rulepacks/jetwco/jetwco-cacc-dependencies.js +6 -0
- package/rulepacks/jetwco/jetwco-cacc-dynamicSlots.js +6 -0
- package/rulepacks/jetwco/jetwco-cacc-eventBubbles.js +6 -0
- package/rulepacks/jetwco/jetwco-cacc-eventCancelable.js +6 -0
- package/rulepacks/jetwco/jetwco-cacc-eventPayload.js +6 -0
- package/rulepacks/jetwco/jetwco-cacc-events.js +6 -0
- package/rulepacks/jetwco/jetwco-cacc-helpers.js +6 -0
- package/rulepacks/jetwco/jetwco-cacc-jetVer.js +6 -0
- package/rulepacks/jetwco/jetwco-cacc-methodParamTypes.js +6 -0
- package/rulepacks/jetwco/jetwco-cacc-methodParams.js +6 -0
- package/rulepacks/jetwco/jetwco-cacc-methodReturnType.js +6 -0
- package/rulepacks/jetwco/jetwco-cacc-methods.js +6 -0
- package/rulepacks/jetwco/jetwco-cacc-packBundle.js +6 -0
- package/rulepacks/jetwco/jetwco-cacc-packBundleContent.js +6 -0
- package/rulepacks/jetwco/jetwco-cacc-packContent.js +6 -0
- package/rulepacks/jetwco/jetwco-cacc-properties.js +6 -0
- package/rulepacks/jetwco/jetwco-cacc-propertyDefault.js +6 -0
- package/rulepacks/jetwco/jetwco-cacc-propertyEnumeration.js +6 -0
- package/rulepacks/jetwco/jetwco-cacc-propertyReadOnly.js +6 -0
- package/rulepacks/jetwco/jetwco-cacc-propertyRequired.js +6 -0
- package/rulepacks/jetwco/jetwco-cacc-propertyType.js +6 -0
- package/rulepacks/jetwco/jetwco-cacc-propertyWriteback.js +6 -0
- package/rulepacks/jetwco/jetwco-cacc-publicModules.js +6 -0
- package/rulepacks/jetwco/jetwco-cacc-slotDataVariable.js +6 -0
- package/rulepacks/jetwco/jetwco-cacc-slotDataVariableType.js +6 -0
- package/rulepacks/jetwco/jetwco-cacc-slots.js +6 -0
- package/rulepacks/jetwco/jetwco-cacc-styleClasses.js +6 -0
- package/rulepacks/jetwco/jetwco-cacc-styleVariables.js +6 -0
- package/rulepacks/jetwco/jetwco-compjson-ns-reg.js +6 -1
- package/rulepacks/jetwco/jetwco-component-api-baseline-changes.js +6 -0
- package/rulepacks/jetwco/jetwco-component-api-changes.js +6 -1
- package/rulepacks/jetwco/jetwco-component-api-controlled-changes.js +6 -0
- package/rulepacks/jetwco/jetwco-component-cdn.js +6 -1
- package/rulepacks/jetwco/jetwco-description-standards.js +6 -0
- package/rulepacks/jetwco/jetwco-displayname-standards.js +6 -0
- package/rulepacks/jetwco/jetwco-exchange-version-check.js +6 -1
- package/rulepacks/jetwco/jetwco-license-info.js +6 -1
- package/rulepacks/jetwco/jetwco-prerelease-cdn.js +6 -1
- package/rulepacks/jetwco/jetwco-thirdparty-ba.js +6 -1
- package/rulepacks/jetwco/msgid.json +6 -0
- package/rulepacks/jetwco/rules.json +6 -1
- package/rulepacks/spoc/msgid.json +5 -0
- package/rulepacks/spoc/rules.json +5 -0
- package/rulepacks/spoc/spoc-dom-manip-inv-tag.js +5 -0
- package/rulepacks/spoc/spoc-dom-manip-tag-pos.js +5 -0
- package/rulepacks/spoc/spoc-dom-manip.js +5 -0
- package/{tests/rules/oj-js-diagnose/js_FAIL_1.js → rulepacks/wdt/msgid.json} +3 -9
- package/rulepacks/wdt/rules.json +6 -0
- package/rulepacks/wdt/wd-driver-sleep.js +6 -0
- package/rulepacks/wdt/wd-xpath.js +6 -0
- package/rules/jaf/jaf-css-diagnose.js +5 -0
- package/rules/jaf/jaf-html-diagnose.js +5 -0
- package/rules/jaf/jaf-init-schema.js +5 -0
- package/rules/jaf/jaf-js-diagnose.js +5 -0
- package/rules/jaf/jaf-ts-diagnose.js +6 -0
- package/rules/jaf/msgid.json +6 -1
- package/rules/jaf/rules.json +6 -1
- package/rules/jet/helpers/acc-aria-label.js +6 -1
- package/rules/jet/helpers/bp-checkPropType.js +5 -0
- package/rules/jet/helpers/cssHelper.js +6 -1
- package/rules/jet/helpers/extractStylesFromClass.js +6 -1
- package/rules/jet/helpers/has-slot-name.js +6 -1
- package/rules/jet/helpers/has-slot.js +5 -0
- package/rules/jet/helpers/json-prop-pos.js +5 -0
- package/rules/jet/helpers/json-propname-pos.js +5 -0
- package/rules/jet/helpers/style-selector.js +6 -1
- package/rules/jet/helpers/valid-attr.js +5 -0
- package/rules/jet/helpers/vartrack.js +5 -0
- package/rules/jet/jet-css-ojselector.js +5 -0
- package/rules/jet/msgid.json +6 -1
- package/rules/jet/oj-acc-aria-labelledby.js +5 -0
- package/rules/jet/oj-acc-aria-prop.js +6 -1
- package/rules/jet/oj-acc-avatar-aria-role.js +6 -1
- package/rules/jet/oj-acc-combobox-aria-label.js +6 -1
- package/rules/jet/oj-acc-film-strip-aria-label.js +6 -1
- package/rules/jet/oj-acc-input-aria-label.js +6 -1
- package/rules/jet/oj-acc-select-aria-label.js +6 -1
- package/rules/jet/oj-cca-compjson-bp-ar.js +5 -0
- package/rules/jet/oj-cca-compjson-bp-dsplyname.js +5 -0
- package/rules/jet/oj-cca-compjson-bp-jetver.js +5 -0
- package/rules/jet/oj-cca-compjson-bp-obj.js +5 -0
- package/rules/jet/oj-cca-compjson-ns-reg.js +5 -0
- package/rules/jet/oj-css-bp-border-color.js +5 -0
- package/rules/jet/oj-css-bp-dir-flow.js +6 -1
- package/rules/jet/oj-css-bp-float.js +5 -0
- package/rules/jet/oj-css-bp-textalign.js +5 -0
- package/rules/jet/oj-css-style-abs-units.js +6 -1
- package/rules/jet/oj-css-style-bp-color.js +5 -0
- package/rules/jet/oj-css-style-bp-display.js +6 -1
- package/rules/jet/oj-css-style-bp-font-family.js +6 -1
- package/rules/jet/oj-css-style-bp-font.js +5 -0
- package/rules/jet/oj-css-style-deprecated.js +6 -1
- package/rules/jet/oj-css-style-override.js +6 -1
- package/rules/jet/oj-css-var-override.js +5 -0
- package/rules/jet/oj-form-maxcols.js +6 -1
- package/rules/jet/oj-html-5-attr-obs.js +5 -0
- package/rules/jet/oj-html-5-tag-obs.js +5 -0
- package/rules/jet/oj-html-alta-deprecated.js +6 -0
- package/rules/jet/oj-html-attr-$unique.js +5 -0
- package/rules/jet/oj-html-attr-2def.js +5 -0
- package/rules/jet/oj-html-attr-json.js +6 -1
- package/rules/jet/oj-html-attr-prefix-expr.js +6 -1
- package/rules/jet/oj-html-attr-prefix-ro.js +5 -0
- package/rules/jet/oj-html-attr-req.js +5 -0
- package/rules/jet/oj-html-bindforeach-data.js +6 -1
- package/rules/jet/oj-html-bindif-test.js +6 -1
- package/rules/jet/oj-html-binding-attr.js +6 -1
- package/rules/jet/oj-html-cca-count.js +5 -0
- package/rules/jet/oj-html-cca-tagname.js +6 -1
- package/rules/jet/oj-html-cdn.js +5 -0
- package/rules/jet/oj-html-combo-converter.js +5 -0
- package/rules/jet/oj-html-cspexpr.js +6 -1
- package/rules/jet/oj-html-databind-all.js +5 -0
- package/rules/jet/oj-html-dlg-title.js +6 -1
- package/rules/jet/oj-html-file-pick-accept.js +6 -1
- package/rules/jet/oj-html-form-bindif.js +6 -1
- package/rules/jet/oj-html-form-layout-maxcols.js +6 -1
- package/rules/jet/oj-html-form-noflex.js +5 -0
- package/rules/jet/oj-html-input-isodate.js +6 -0
- package/rules/jet/oj-html-invalid-doctype.js +6 -1
- package/rules/jet/oj-html-jq-databind.js +6 -1
- package/rules/jet/oj-html-ko-comment.js +5 -0
- package/rules/jet/oj-html-ko-databind.js +6 -1
- package/rules/jet/oj-html-label-for-prefix.js +5 -0
- package/rules/jet/oj-html-missing-doctype.js +6 -1
- package/rules/jet/oj-html-msgs-cat-text.js +6 -0
- package/rules/jet/oj-html-no-style-tag.js +6 -0
- package/rules/jet/oj-html-notag-style.js +6 -0
- package/rules/jet/oj-html-oj-lib.js +5 -0
- package/rules/jet/oj-html-ojattr-520.js +6 -1
- package/rules/jet/oj-html-ojattr-deprecated.js +6 -1
- package/rules/jet/oj-html-ojattr-enum-deprecated.js +6 -1
- package/rules/jet/oj-html-ojattr-evt-syntax.js +6 -1
- package/rules/jet/oj-html-ojattr-value.js +6 -1
- package/rules/jet/oj-html-ojattr.js +6 -1
- package/rules/jet/oj-html-ojevent.js +6 -1
- package/rules/jet/oj-html-ojslot.js +6 -1
- package/rules/jet/oj-html-ojstyle.js +5 -0
- package/rules/jet/oj-html-ojtag-datacmd.js +6 -1
- package/rules/jet/oj-html-ojtag-datactx.js +5 -0
- package/rules/jet/oj-html-ojtag-deprecated.js +6 -1
- package/rules/jet/oj-html-ojtag-globattr-noprefix.js +6 -1
- package/rules/jet/oj-html-ojtag-id.js +5 -0
- package/rules/jet/oj-html-ojtag-nonglobattr-prefix.js +6 -1
- package/rules/jet/oj-html-ojtag-ns.js +5 -0
- package/rules/jet/oj-html-picker-attrs.js +6 -0
- package/rules/jet/oj-html-redwood-cssnovars.js +6 -0
- package/rules/jet/oj-html-redwood-cssvars.js +6 -0
- package/rules/jet/oj-html-self-close.js +5 -0
- package/rules/jet/oj-html-slot-item-minmax.js +6 -0
- package/rules/jet/oj-html-slot-name.js +6 -1
- package/rules/jet/oj-html-slot-pref-content.js +6 -0
- package/rules/jet/oj-html-style-abs-units.js +5 -0
- package/rules/jet/oj-html-style-bp-color.js +5 -0
- package/rules/jet/oj-html-style-bp-display.js +6 -1
- package/rules/jet/oj-html-style-bp-font-family.js +5 -0
- package/rules/jet/oj-html-style-bp-font.js +5 -0
- package/rules/jet/oj-html-style-deprecated.js +6 -1
- package/rules/jet/oj-html-style.js +6 -1
- package/rules/jet/oj-html-stylesel.js +6 -1
- package/rules/jet/oj-html-tag-attr-noprefix.js +6 -1
- package/rules/jet/oj-html-template-index.js +6 -1
- package/rules/jet/oj-html-unsup-theme.js +6 -1
- package/rules/jet/oj-html-wctag-$props.js +6 -1
- package/rules/jet/oj-html-wctag-arialabelledby.js +5 -0
- package/rules/jet/oj-html-wctag-for.js +5 -0
- package/rules/jet/oj-html-wctag-id.js +6 -1
- package/rules/jet/oj-html-wctag-nested.js +6 -0
- package/rules/jet/oj-html-wctag-packprivate.js +6 -0
- package/rules/jet/oj-js-comp-attr-deprecated.js +6 -1
- package/rules/jet/oj-js-comp-meth-deprecated.js +6 -1
- package/rules/jet/oj-js-no-ext-final.js +5 -0
- package/rules/jet/oj-js-noconsole.js +5 -0
- package/rules/jet/oj-js-ojcomp-deprecated.js +6 -1
- package/rules/jet/oj-js-ojcomp-exist.js +5 -0
- package/rules/jet/oj-js-ojcomp-new.js +5 -0
- package/rules/jet/oj-js-poly-promise.js +6 -1
- package/rules/jet/oj-js-var-undef.js +5 -0
- package/rules/jet/oj-json-syntax.js +5 -0
- package/rules/jet/oj-ts-comp-attr-deprecated.js +6 -1
- package/rules/jet/oj-ts-comp-meth-deprecated.js +6 -1
- package/rules/jet/oj-ts-no-ext-final.js +6 -0
- package/rules/jet/oj-ts-noconsole.js +6 -1
- package/rules/jet/oj-ts-ojcomp-deprecated.js +6 -1
- package/rules/jet/oj-ts-ojcomp-exist.js +6 -1
- package/rules/jet/oj-ts-ojcomp-new.js +6 -1
- package/rules/jet/oj-ts-poly-promise.js +6 -1
- package/rules/jet/rules.json +6 -1
- package/schema/component-schema.json +125 -2
- package/src/JafCore.js +6 -1
- package/types/index.d.ts +175 -37
- package/lib/stats.js +0 -1
- package/rulepacks/jetwc-lib/component-audit-utils.js +0 -1
- package/rules/exch/helpers/json-prop-pos.js +0 -1
- package/rules/exch/msgid.json +0 -1
- package/rules/exch/oj-cca-comp-zip-content-composite.js +0 -1
- package/rules/exch/oj-cca-comp-zip-content-pack.js +0 -1
- package/rules/exch/oj-cca-comp-zip-expand.js +0 -1
- package/rules/exch/oj-cca-compjson-evnames.js +0 -1
- package/rules/exch/oj-cca-compjson-file.js +0 -1
- package/rules/exch/oj-cca-compjson-prefix.js +0 -1
- package/rules/exch/oj-cca-compjson-prop-compdeps.js +0 -1
- package/rules/exch/oj-cca-compjson-prop-deps.js +0 -1
- package/rules/exch/oj-cca-compjson-prop-jetver.js +0 -1
- package/rules/exch/oj-cca-compjson-prop-obs.js +0 -1
- package/rules/exch/oj-cca-compjson-prop-type.js +0 -1
- package/rules/exch/oj-cca-compjson-prop-types.js +0 -1
- package/rules/exch/oj-cca-compjson-prop-undef.js +0 -1
- package/rules/exch/oj-cca-compjson-prop-version.js +0 -1
- package/rules/exch/oj-cca-compjson-schema.js +0 -1
- package/rules/exch/oj-cca-zip-compjson.js +0 -1
- package/rules/exch/rules.json +0 -1
- package/rules/jet/oj-css-bp-bgcolor.js +0 -1
- package/tests/components/attr-req-test/component.json +0 -1
- package/tests/components/demo-analog-clock/component.json +0 -1
- package/tests/components/demo-analog-clock/demo-analog-clock-viewModel.js +0 -1
- package/tests/components/demo-analog-clock/extension/demo/js/viewModels/demo.js +0 -1
- package/tests/components/demo-analog-clock/loader.js +0 -1
- package/tests/components/demo-card/component.json +0 -1
- package/tests/components/demo-chart-orientation-control/component.json +0 -1
- package/tests/components/demo-chart-stack-control/component.json +0 -1
- package/tests/components/made-up/component.json +0 -1
- package/tests/components/oj-made-up/component.json +0 -1
- package/tests/components/sp-activity-item/component.json +0 -1
- package/tests/config/config_base.json +0 -1
- package/tests/golden/10.0.0/golden_base.json +0 -1
- package/tests/golden/8.1.0/golden_base.json +0 -1
- package/tests/golden/9.0.0/golden_base.json +0 -1
- package/tests/rulepacks/hooks/hook-rpext.js +0 -1
- package/tests/rulepacks/hooks/hook-start-close-rulepack.js +0 -1
- package/tests/rulepacks/hooks/rule-rpext.js +0 -1
- package/tests/rulepacks/hooks/rules.json +0 -1
- package/tests/rulepacks/tags/proc_directive.js +0 -1
- package/tests/rulepacks/tags/rules.json +0 -1
- package/tests/rulepacks/tags/tag-count-setup.js +0 -1
- package/tests/rulepacks/tags/tag-count.js +0 -1
- package/tests/rules/bugs/JET-4770_PASS_1.html +0 -9
- package/tests/rules/comments/com_FAIL_1.js +0 -57
- package/tests/rules/comments/com_FAIL_2.js +0 -96
- package/tests/rules/comments/com_PASS_1.js +0 -42
- package/tests/rules/comments/com_PASS_2.js +0 -63
- package/tests/rules/comments/com_PASS_3.js +0 -40
- package/tests/rules/comments/com_PASS_4.js +0 -36
- package/tests/rules/comments/com_PASS_5.js +0 -19
- package/tests/rules/csp/html-script-unsafe-inline/FAIL_1.html +0 -11
- package/tests/rules/csp/html-script-unsafe-inline/FAIL_2.html +0 -8
- package/tests/rules/csp/html-script-unsafe-inline/PASS_1.html +0 -8
- package/tests/rules/csp/html-script-unsafe-inline/PASS_2.html +0 -8
- package/tests/rules/csp/html-script-unsafe-inline/PASS_3.html +0 -8
- package/tests/rules/csp/html-style-unsafe-inline/FAIL_1.html +0 -11
- package/tests/rules/csp/html-style-unsafe-inline/PASS_1.html +0 -11
- package/tests/rules/csp/html-unsafe-expr/FAIL_1.html +0 -14
- package/tests/rules/csp/html-unsafe-expr/PASS_1.html +0 -23
- package/tests/rules/csp/js-script-unsafe-eval/FAIL_1.js +0 -17
- package/tests/rules/csp/js-script-unsafe-eval/FAIL_2.js +0 -40
- package/tests/rules/csp/js-script-unsafe-eval/FAIL_3.js +0 -22
- package/tests/rules/csp/js-script-unsafe-eval/PASS_1.js +0 -20
- package/tests/rules/csp/js-script-unsafe-eval/PASS_2.js +0 -44
- package/tests/rules/csp/js-script-unsafe-eval/PASS_3.js +0 -16
- package/tests/rules/csp/js-style-unsafe-inline/FAIL_1.js +0 -25
- package/tests/rules/csp/js-style-unsafe-inline/PASS.js +0 -22
- package/tests/rules/demo/noself_FAIL_1.js +0 -101
- package/tests/rules/import/import_FAIL_1.js +0 -11
- package/tests/rules/import/import_PASS_1.js +0 -10
- package/tests/rules/jet-composites/demo-buttonset-enum/component.json +0 -57
- package/tests/rules/jet-composites/demo-buttonset-enum/loader.js +0 -19
- package/tests/rules/jet-composites/demo-buttonset-enum/view.html +0 -48
- package/tests/rules/jet-composites/demo-card/component.json +0 -28
- package/tests/rules/jet-composites/demo-card/loader.js +0 -16
- package/tests/rules/jet-composites/demo-card/view.html +0 -30
- package/tests/rules/jet-composites/demo-card/viewModel.js +0 -46
- package/tests/rules/jet-composites/demo-card/view_PASS_1.html +0 -21
- package/tests/rules/jet-composites/demo-contact-form/component.json +0 -23
- package/tests/rules/jet-composites/demo-contact-form/loader.js +0 -16
- package/tests/rules/jet-composites/demo-contact-form/view.html +0 -9
- package/tests/rules/jet-composites/demo-grocery-list/component.json +0 -18
- package/tests/rules/jet-composites/demo-grocery-list/loader.js +0 -19
- package/tests/rules/jet-composites/demo-grocery-list/view.html +0 -22
- package/tests/rules/jet-composites/demo-grocery-list/viewModel.js +0 -48
- package/tests/rules/jet-composites/dummy-component-1/component.json +0 -82
- package/tests/rules/jet-composites/dummy-component-2/component.json +0 -72
- package/tests/rules/jet-composites/foo-my-cca/component.json +0 -14
- package/tests/rules/jet-composites/foo-unsup-theme/component.json +0 -29
- package/tests/rules/jet-composites/header/component.json +0 -12
- package/tests/rules/jet-composites/oj-cgbu-omc/attribute-selection/component.json +0 -154
- package/tests/rules/jet-composites/oj-cgbu-omc/component.json +0 -11
- package/tests/rules/jet-composites/oj-cgbu-omc/reference/component.json +0 -185
- package/tests/rules/jet-composites/oj-cgbu-omc/wctag_props_FAIL_1.html +0 -34
- package/tests/rules/jet-composites/oj-enum-depr/component.json +0 -69
- package/tests/rules/jet-composites/oj-html-wctag-id/id_FAIL_1.html +0 -10
- package/tests/rules/jet-composites/oj-html-wctag-id/id_PASS_1.html +0 -6
- package/tests/rules/misc/oj.js +0 -12
- package/tests/rules/oj-acc-aria-labelledby/aria_labelledby_FAIL_1.html +0 -23
- package/tests/rules/oj-acc-aria-labelledby/aria_labelledby_FAIL_2.html +0 -22
- package/tests/rules/oj-acc-aria-labelledby/aria_labelledby_PASS_1.html +0 -23
- package/tests/rules/oj-acc-aria-labelledby/aria_labelledby_PASS_2.html +0 -22
- package/tests/rules/oj-acc-aria-labelledby/aria_labelledby_PASS_3.html +0 -22
- package/tests/rules/oj-acc-aria-labelledby/aria_labelledby_PASS_4.html +0 -22
- package/tests/rules/oj-acc-aria-labelledby/aria_labelledby_PASS_5.html +0 -22
- package/tests/rules/oj-acc-aria-prop/aria_prop_FAIL_1.html +0 -22
- package/tests/rules/oj-acc-avatar-aria-role/aria_avatar_role_FAIL_1.html +0 -20
- package/tests/rules/oj-acc-avatar-aria-role/aria_avatar_role_PASS_1.html +0 -23
- package/tests/rules/oj-acc-avatar-aria-role/aria_avatar_role_PASS_2.html +0 -24
- package/tests/rules/oj-acc-avatar-aria-role/aria_avatar_role_PASS_3.html +0 -21
- package/tests/rules/oj-acc-avatar-aria-role/aria_avatar_role_PASS_4.html +0 -22
- package/tests/rules/oj-acc-avatar-aria-role/aria_avatar_role_PASS_5.html +0 -22
- package/tests/rules/oj-acc-combobox-aria-label/aria_combo_many_FAIL_1.html +0 -20
- package/tests/rules/oj-acc-combobox-aria-label/aria_combo_many_FAIL_2.html +0 -21
- package/tests/rules/oj-acc-combobox-aria-label/aria_combo_many_PASS_1.html +0 -20
- package/tests/rules/oj-acc-combobox-aria-label/aria_combo_one_FAIL_1.html +0 -21
- package/tests/rules/oj-acc-combobox-aria-label/aria_combo_one_FAIL_2.html +0 -22
- package/tests/rules/oj-acc-combobox-aria-label/aria_combo_one_PASS_1.html +0 -22
- package/tests/rules/oj-acc-film-strip-aria-label/aria_filmstrip_FAIL_1.html +0 -18
- package/tests/rules/oj-acc-film-strip-aria-label/aria_filmstrip_FAIL_2.html +0 -18
- package/tests/rules/oj-acc-film-strip-aria-label/aria_filmstrip_PASS_1.html +0 -18
- package/tests/rules/oj-acc-film-strip-aria-label/aria_filmstrip_PASS_2.html +0 -19
- package/tests/rules/oj-acc-film-strip-aria-label/aria_filmstrip_PASS_3.html +0 -22
- package/tests/rules/oj-acc-input-aria-label/oj_input_date_FAIL_1.html +0 -21
- package/tests/rules/oj-acc-input-aria-label/oj_input_date_FAIL_2.html +0 -22
- package/tests/rules/oj-acc-input-aria-label/oj_input_date_PASS_1.html +0 -16
- package/tests/rules/oj-acc-input-aria-label/oj_input_date_PASS_2.html +0 -17
- package/tests/rules/oj-acc-input-aria-label/oj_input_date_PASS_3.html +0 -26
- package/tests/rules/oj-acc-input-aria-label/oj_input_date_time_FAIL_1.html +0 -19
- package/tests/rules/oj-acc-input-aria-label/oj_input_date_time_FAIL_2.html +0 -20
- package/tests/rules/oj-acc-input-aria-label/oj_input_date_time_PASS_1.html +0 -19
- package/tests/rules/oj-acc-input-aria-label/oj_input_number_FAIL_1.html +0 -17
- package/tests/rules/oj-acc-input-aria-label/oj_input_number_FAIL_2.html +0 -18
- package/tests/rules/oj-acc-input-aria-label/oj_input_number_PASS_1.html +0 -17
- package/tests/rules/oj-acc-input-aria-label/oj_input_password_FAIL_1.html +0 -17
- package/tests/rules/oj-acc-input-aria-label/oj_input_password_FAIL_2.html +0 -17
- package/tests/rules/oj-acc-input-aria-label/oj_input_password_PASS_1.html +0 -17
- package/tests/rules/oj-acc-input-aria-label/oj_input_text_3_PASS_1.html +0 -20
- package/tests/rules/oj-acc-input-aria-label/oj_input_text_FAIL_1.html +0 -20
- package/tests/rules/oj-acc-input-aria-label/oj_input_text_FAIL_2.html +0 -21
- package/tests/rules/oj-acc-input-aria-label/oj_input_text_PASS_2.html +0 -62
- package/tests/rules/oj-acc-input-aria-label/oj_input_text_nolabel_PASS_2.html +0 -17
- package/tests/rules/oj-acc-input-aria-label/oj_input_time_FAIL_1.html +0 -19
- package/tests/rules/oj-acc-input-aria-label/oj_input_time_FAIL_2.html +0 -20
- package/tests/rules/oj-acc-input-aria-label/oj_input_time_PASS_1.html +0 -19
- package/tests/rules/oj-acc-select-aria-label/aria_selectmany_FAIL_1.html +0 -19
- package/tests/rules/oj-acc-select-aria-label/aria_selectmany_FAIL_2.html +0 -20
- package/tests/rules/oj-acc-select-aria-label/aria_selectmany_PASS_1.html +0 -19
- package/tests/rules/oj-acc-select-aria-label/aria_selectone_FAIL_1.html +0 -20
- package/tests/rules/oj-acc-select-aria-label/aria_selectone_FAIL_2.html +0 -21
- package/tests/rules/oj-cca-comp-zip/zip_FAIL_1.zip +0 -1
- package/tests/rules/oj-cca-comp-zip/zip_FAIL_2.zip +0 -0
- package/tests/rules/oj-cca-comp-zip/zip_FAIL_3.zip +0 -0
- package/tests/rules/oj-cca-comp-zip/zip_FAIL_4.zip +0 -0
- package/tests/rules/oj-cca-comp-zip/zip_FAIL_5.zip +0 -0
- package/tests/rules/oj-cca-comp-zip/zip_FAIL_6.zip +0 -0
- package/tests/rules/oj-cca-comp-zip/zip_FAIL_7.zip +0 -0
- package/tests/rules/oj-cca-comp-zip/zip_FAIL_8.zip +0 -0
- package/tests/rules/oj-cca-comp-zip/zip_PASS_1.zip +0 -0
- package/tests/rules/oj-cca-ns-reg/oj-cca-ns-FAIL_1/component.json +0 -19
- package/tests/rules/oj-cca-ns-reg/oj-cca-ns-PASS_1/component.json +0 -19
- package/tests/rules/oj-cgbu-omc_tests/html_ojevent_FAIL_1.html +0 -15
- package/tests/rules/oj-cgbu-omc_tests/html_ojevent_PASS_1.html +0 -17
- package/tests/rules/oj-compjson-syntax/ojcomp-FAIL_1/component.json +0 -16
- package/tests/rules/oj-compjson-syntax/ojcomp-FAIL_10/component.json +0 -103
- package/tests/rules/oj-compjson-syntax/ojcomp-FAIL_11/component.json +0 -24
- package/tests/rules/oj-compjson-syntax/ojcomp-FAIL_12/component.json +0 -17
- package/tests/rules/oj-compjson-syntax/ojcomp-FAIL_13/component.json +0 -17
- package/tests/rules/oj-compjson-syntax/ojcomp-FAIL_14/component.json +0 -40
- package/tests/rules/oj-compjson-syntax/ojcomp-FAIL_15/component.json +0 -24
- package/tests/rules/oj-compjson-syntax/ojcomp-FAIL_16/component.json +0 -44
- package/tests/rules/oj-compjson-syntax/ojcomp-FAIL_17/component.json +0 -8
- package/tests/rules/oj-compjson-syntax/ojcomp-FAIL_18/component.json +0 -8
- package/tests/rules/oj-compjson-syntax/ojcomp-FAIL_19/component.json +0 -8
- package/tests/rules/oj-compjson-syntax/ojcomp-FAIL_2/component.json +0 -15
- package/tests/rules/oj-compjson-syntax/ojcomp-FAIL_20/component.json +0 -18
- package/tests/rules/oj-compjson-syntax/ojcomp-FAIL_21/component.json +0 -16
- package/tests/rules/oj-compjson-syntax/ojcomp-FAIL_22/component.json +0 -19
- package/tests/rules/oj-compjson-syntax/ojcomp-FAIL_3/component.json +0 -15
- package/tests/rules/oj-compjson-syntax/ojcomp-FAIL_4/component.json +0 -16
- package/tests/rules/oj-compjson-syntax/ojcomp-FAIL_5/component.json +0 -16
- package/tests/rules/oj-compjson-syntax/ojcomp-FAIL_6/component.json +0 -18
- package/tests/rules/oj-compjson-syntax/ojcomp-FAIL_7/component.json +0 -15
- package/tests/rules/oj-compjson-syntax/ojcomp-FAIL_8/component.json +0 -15
- package/tests/rules/oj-compjson-syntax/ojcomp-FAIL_9/component.json +0 -52
- package/tests/rules/oj-compjson-syntax/ojcomp-PASS_1/component.json +0 -17
- package/tests/rules/oj-compjson-syntax/ojcomp-PASS_2/component.json +0 -88
- package/tests/rules/oj-compjson-syntax/ojcomp-PASS_3/component.json +0 -19
- package/tests/rules/oj-css-bp-dir-flow/dirflow_FAIL_1.html +0 -22
- package/tests/rules/oj-css-bp-dir-flow/dirflow_FAIL_2.html +0 -22
- package/tests/rules/oj-css-diagnose/css_FAIL_1.html +0 -14
- package/tests/rules/oj-css-diagnose/css_PASS_1.html +0 -14
- package/tests/rules/oj-css-var-override/varovr_FAIL_1.html +0 -8
- package/tests/rules/oj-html-5-attr-depr/attrdepr_FAIL_1.html +0 -16
- package/tests/rules/oj-html-5-attr-depr/attrdepr_PASS_1.html +0 -16
- package/tests/rules/oj-html-5-tag-depr/tagdepr_FAIL_1.html +0 -9
- package/tests/rules/oj-html-attr/attr_FAIL_1.html +0 -27
- package/tests/rules/oj-html-attr-$unique/attr_$unique1_FAIL_1.html +0 -19
- package/tests/rules/oj-html-attr-$unique/attr_$unique_FAIL_2.html +0 -25
- package/tests/rules/oj-html-attr-2def/attr2def_FAIL_1.html +0 -10
- package/tests/rules/oj-html-attr-2def/attr2def_PASS_1.html +0 -10
- package/tests/rules/oj-html-attr-json/attr-json_FAIL_1.html +0 -20
- package/tests/rules/oj-html-attr-json/attr-json_FAIL_2.html +0 -20
- package/tests/rules/oj-html-attr-json/attr-json_FAIL_3.html +0 -20
- package/tests/rules/oj-html-attr-json/attr-json_PASS_1.html +0 -20
- package/tests/rules/oj-html-attr-json/attr-json_PASS_2.html +0 -20
- package/tests/rules/oj-html-attr-json/attr-json_PASS_3.html +0 -8
- package/tests/rules/oj-html-attr-prefix-expr/attrprefixexpr_FAIL_1.html +0 -10
- package/tests/rules/oj-html-attr-prefix-expr/attrprefixexpr_PASS_1.html +0 -10
- package/tests/rules/oj-html-attr-prefix-ro/attrprefixro_FAIL_1.html +0 -10
- package/tests/rules/oj-html-attr-prefix-ro/attrprefixro_PASS_1.html +0 -10
- package/tests/rules/oj-html-attr-req/attrreq_FAIL_1.html +0 -17
- package/tests/rules/oj-html-attr-req/attrreq_FAIL_2.html +0 -13
- package/tests/rules/oj-html-attr-req/attrreq_FAIL_3.html +0 -8
- package/tests/rules/oj-html-attr-req/attrreq_FAIL_4.html +0 -13
- package/tests/rules/oj-html-attr-req/attrreq_FAIL_5.html +0 -17
- package/tests/rules/oj-html-attr-req/attrreq_PASS_1.html +0 -24
- package/tests/rules/oj-html-attr-req/attrreq_PASS_2.html +0 -24
- package/tests/rules/oj-html-attr-req/attrreq_PASS_3.html +0 -10
- package/tests/rules/oj-html-attr-req/attrreq_PASS_4.html +0 -11
- package/tests/rules/oj-html-bindforeach-data/bindforeach_data_FAIL_1.html +0 -19
- package/tests/rules/oj-html-bindforeach-data/bindforeach_data_PASS_1.html +0 -10
- package/tests/rules/oj-html-bindif-test/bindif_test_FAIL_1.html +0 -22
- package/tests/rules/oj-html-bindif-test/bindif_test_PASS_1.html +0 -11
- package/tests/rules/oj-html-binding-attr/binding-foreach_FAIL_2.html +0 -28
- package/tests/rules/oj-html-binding-attr/binding-if_FAIL_1.html +0 -23
- package/tests/rules/oj-html-binding-attr/binding-if_PASS_1.html +0 -23
- package/tests/rules/oj-html-cca-count/cca-count_FAIL_1.html +0 -119
- package/tests/rules/oj-html-cca-tagname/ccatag_FAIL_1.html +0 -7
- package/tests/rules/oj-html-cca-tagname/ccatag_PASS_1.html +0 -7
- package/tests/rules/oj-html-cca-tagname/tag_ns_FAIL_1.html +0 -8
- package/tests/rules/oj-html-cca-tagname/tag_ns_FAIL_2.html +0 -8
- package/tests/rules/oj-html-cca-tagname/tag_ns_FAIL_3.html +0 -8
- package/tests/rules/oj-html-cca-tagname/tag_ns_PASS_1.html +0 -10
- package/tests/rules/oj-html-cdn/html_cdn_FAIL_1.html +0 -18
- package/tests/rules/oj-html-cspexpr/cspexpr_FAIL_1.html +0 -14
- package/tests/rules/oj-html-cspexpr/cspexpr_FAIL_2.html +0 -10
- package/tests/rules/oj-html-cspexpr/cspexpr_PASS_1.html +0 -23
- package/tests/rules/oj-html-cspexpr/cspexpr_PASS_2.html +0 -10
- package/tests/rules/oj-html-cspexpr/cspexpr_PASS_3.html +0 -13
- package/tests/rules/oj-html-dlg-title/dlgtitle_FAIL_1.html +0 -12
- package/tests/rules/oj-html-dlg-title/dlgtitle_PASS_1.html +0 -12
- package/tests/rules/oj-html-form-noflex/noflex_FAIL_1.html +0 -10
- package/tests/rules/oj-html-invalid-doctype/doctype_invalid_FAIL_1.html +0 -20
- package/tests/rules/oj-html-invalid-doctype/doctype_invalid_FAIL_2.html +0 -13
- package/tests/rules/oj-html-invalid-doctype/doctype_invalid_FAIL_3.html +0 -16
- package/tests/rules/oj-html-invalid-doctype/doctype_invalid_FAIL_4.html +0 -13
- package/tests/rules/oj-html-invalid-doctype/doctype_invalid_PASS_1.html +0 -6
- package/tests/rules/oj-html-invalid-doctype/doctype_invalid_PASS_2.html +0 -7
- package/tests/rules/oj-html-invalid-doctype/doctype_invalid_PASS_3.html +0 -7
- package/tests/rules/oj-html-jq-databind/jq-databind_FAIL_1.html +0 -37
- package/tests/rules/oj-html-jq-databind/jq-databind_FAIL_2.html +0 -34
- package/tests/rules/oj-html-jq-databind/jq-databind_FAIL_3.html +0 -27
- package/tests/rules/oj-html-jq-databind/jq-databind_PASS_1.html +0 -30
- package/tests/rules/oj-html-ko-comment/ko-comment_FAIL_1.html +0 -47
- package/tests/rules/oj-html-ko-comment/ko-comment_FAIL_2.html +0 -36
- package/tests/rules/oj-html-ko-databind/ko-databind_FAIL_1.html +0 -24
- package/tests/rules/oj-html-ko-databind/ko-databind_FAIL_2.html +0 -36
- package/tests/rules/oj-html-ko-databind/ko-databind_FAIL_3.html +0 -29
- package/tests/rules/oj-html-label-for-prefix/for_FAIL_1.html +0 -8
- package/tests/rules/oj-html-label-for-prefix/for_PASS_1.html +0 -8
- package/tests/rules/oj-html-missing-doctype/doctype_missing_FAIL_1.html +0 -12
- package/tests/rules/oj-html-missing-doctype/doctype_missing_FAIL_2.html +0 -11
- package/tests/rules/oj-html-missing-doctype/doctype_missing_PASS_1.html +0 -14
- package/tests/rules/oj-html-missing-doctype/doctype_missing_PASS_2.html +0 -5
- package/tests/rules/oj-html-missing-doctype/doctype_missing_PASS_3.html +0 -12
- package/tests/rules/oj-html-missing-doctype/doctype_missing_PASS_5.html +0 -6
- package/tests/rules/oj-html-nonvoid-close/close_FAIL_1.html +0 -28
- package/tests/rules/oj-html-nonvoid-close/close_FAIL_2.html +0 -14
- package/tests/rules/oj-html-nonvoid-close/close_FAIL_3.html +0 -13
- package/tests/rules/oj-html-nonvoid-close/close_FAIL_5.html +0 -28
- package/tests/rules/oj-html-nonvoid-close/close_FAIL_6.html +0 -28
- package/tests/rules/oj-html-nonvoid-close/close_PASS_1.html +0 -7
- package/tests/rules/oj-html-oj-lib/oj_lib_FAIL_1.html +0 -15
- package/tests/rules/oj-html-ojattr/ojattr_PASS_1.html +0 -8
- package/tests/rules/oj-html-ojattr/ojattr_PASS_2.html +0 -10
- package/tests/rules/oj-html-ojattr/ojattr_PASS_3.html +0 -7
- package/tests/rules/oj-html-ojattr/ojattr_PASS_4.html +0 -7
- package/tests/rules/oj-html-ojattr-deprecated/ojattr-dep_FAIL1.html +0 -156
- package/tests/rules/oj-html-ojattr-enum-deprecated/enum_FAIL_1.html +0 -19
- package/tests/rules/oj-html-ojattr-enum-deprecated/enum_FAIL_2.html +0 -20
- package/tests/rules/oj-html-ojattr-enum-deprecated/enum_PASS_1.html +0 -25
- package/tests/rules/oj-html-ojattr-evt-syntax/evt-attr-syntax_FAIL_1.html +0 -6
- package/tests/rules/oj-html-ojattr-evt-syntax/evt-attr-syntax_PASS_1.html +0 -6
- package/tests/rules/oj-html-ojattr-value/attr-value_FAIL_1.html +0 -26
- package/tests/rules/oj-html-ojattr-value/attr-value_FAIL_2.html +0 -26
- package/tests/rules/oj-html-ojattr-value/attr-value_FAIL_3.html +0 -8
- package/tests/rules/oj-html-ojattr-value/attr-value_FAIL_4.html +0 -8
- package/tests/rules/oj-html-ojattr-value/attr-value_FAIL_5.html +0 -8
- package/tests/rules/oj-html-ojattr-value/attr-value_PASS_1.html +0 -26
- package/tests/rules/oj-html-ojattr-value/attr-value_PASS_2.html +0 -8
- package/tests/rules/oj-html-ojattr-value/attr-value_PASS_3.html +0 -7
- package/tests/rules/oj-html-ojattr-value/attr-value_PASS_6.html +0 -7
- package/tests/rules/oj-html-ojattr-value/attr-value_PASS_7.html +0 -10
- package/tests/rules/oj-html-ojattr-value/attr_value_PASS_4.html +0 -7
- package/tests/rules/oj-html-ojattr-value/attr_value_PASS_5.html +0 -9
- package/tests/rules/oj-html-ojslot/ojslot_FAIL_1.html +0 -11
- package/tests/rules/oj-html-ojslot/ojslot_PASS_1.html +0 -12
- package/tests/rules/oj-html-ojstyle/style_FAIL_1.html +0 -103
- package/tests/rules/oj-html-ojstyle/style_PASS_2.html +0 -7
- package/tests/rules/oj-html-ojtag-datacmd/datacmd_FAIL_1.html +0 -10
- package/tests/rules/oj-html-ojtag-datacmd/datacmd_FAIL_2.html +0 -18
- package/tests/rules/oj-html-ojtag-datacmd/datacmd_FAIL_3.html +0 -10
- package/tests/rules/oj-html-ojtag-datacmd/datacmd_PASS_1.html +0 -28
- package/tests/rules/oj-html-ojtag-datacmd/datacmd_PASS_2.html +0 -15
- package/tests/rules/oj-html-ojtag-datactx/datactx_FAIL_1.html +0 -14
- package/tests/rules/oj-html-ojtag-datactx/datactx_PASS_1.html +0 -14
- package/tests/rules/oj-html-ojtag-globattr-noprefix/globattr-noprefix_FAIL_1.html +0 -36
- package/tests/rules/oj-html-ojtag-nonglobattr-prefix/nonglobattr-prefix_FAIL_1.html +0 -26
- package/tests/rules/oj-html-slot-name/slot_name.FAIL_1.html +0 -24
- package/tests/rules/oj-html-slot-name/slot_name.FAIL_2.html +0 -46
- package/tests/rules/oj-html-slot-name/slot_name.FAIL_3.html +0 -10
- package/tests/rules/oj-html-slot-name/slot_name.PASS_1.html +0 -24
- package/tests/rules/oj-html-slot-name/slot_name.PASS_2.html +0 -39
- package/tests/rules/oj-html-slot-name/slot_name.PASS_3.html +0 -10
- package/tests/rules/oj-html-slot-name/slot_name_PASS_4.html +0 -16
- package/tests/rules/oj-html-slot-name/slot_name_PASS_5.html +0 -11
- package/tests/rules/oj-html-slot-name/slot_name_PASS_6.html +0 -14
- package/tests/rules/oj-html-slot-name/slot_name_PASS_7.html +0 -10
- package/tests/rules/oj-html-style/style_FAIL_1.html +0 -7
- package/tests/rules/oj-html-style/style_PASS_1.html +0 -12
- package/tests/rules/oj-html-style/style_PASS_2.html +0 -7
- package/tests/rules/oj-html-style-bp-color/color-FAIL_1.html +0 -17
- package/tests/rules/oj-html-style-bp-color/color-FAIL_2.html +0 -15
- package/tests/rules/oj-html-style-bp-color/color-FAIL_3.html +0 -7
- package/tests/rules/oj-html-style-bp-color/color-PASS_1.html +0 -7
- package/tests/rules/oj-html-style-bp-font-family/fam_FAIL_1.html +0 -23
- package/tests/rules/oj-html-tag-attr-noprefix/attr-noprefix_FAIL_1.html +0 -15
- package/tests/rules/oj-html-tag-attr-noprefix/attr-noprefix_FAIL_2.html +0 -9
- package/tests/rules/oj-html-tag-attr-noprefix/attr-noprefix_PASS_1.html +0 -9
- package/tests/rules/oj-html-unsup-theme/unsup_FAIL_1.html +0 -8
- package/tests/rules/oj-html-wctag-for/for_FAIL_1.html +0 -8
- package/tests/rules/oj-html-wctag-for/for_PASS_1.html +0 -8
- package/tests/rules/oj-js-comp-attr-deprecated/attr-del_FAIL_1.js +0 -20
- package/tests/rules/oj-js-comp-attr-deprecated/attr-dep_FAIL_1.js +0 -20
- package/tests/rules/oj-js-comp-meth-deprecated/meth-del_FAIL_1.js +0 -20
- package/tests/rules/oj-js-comp-meth-deprecated/meth-dep_FAIL_1.js +0 -20
- package/tests/rules/oj-js-define-promise/def-prom_FAIL_1.js +0 -16
- package/tests/rules/oj-js-define-promise/def-prom_FAIL_2.js +0 -16
- package/tests/rules/oj-js-diagnose/es6_PASS_1.js +0 -24
- package/tests/rules/oj-js-no-ext-final/noextfinal_FAIL_1.js +0 -30
- package/tests/rules/oj-js-no-ext-final/noextfinal_FAIL_2.js +0 -23
- package/tests/rules/oj-js-no-ext-final/noextfinal_FAIL_3.js +0 -22
- package/tests/rules/oj-js-no-ext-final/noextfinal_FAIL_4.js +0 -20
- package/tests/rules/oj-js-no-ext-final/noextfinal_FAIL_5.js +0 -24
- package/tests/rules/oj-js-no-ext-final/noextfinal_FAIL_6.js +0 -30
- package/tests/rules/oj-js-no-ext-final/noextfinal_FAIL_7.js +0 -15
- package/tests/rules/oj-js-no-ext-final/noextfinal_FAIL_8.js +0 -16
- package/tests/rules/oj-js-no-ext-final/noextfinal_PASS_1.js +0 -17
- package/tests/rules/oj-js-no-ext-final/noextfinal_PASS_2.js +0 -17
- package/tests/rules/oj-js-noconsole/nocons_FAIL_1.js +0 -11
- package/tests/rules/oj-js-ojcomp-deprecated/jscomp_FAIL_1.js +0 -27
- package/tests/rules/oj-json-syntax/json_FAIL_1.json +0 -8
- package/tests/rules/oj-json-syntax/json_FAIL_2.json +0 -12
- package/tests/rules/oj-json-syntax/json_PASS_1.json +0 -25
- package/tests/rules/oj-json-syntax/json_PASS_2.json +0 -12
- package/tests/rules/oj-json-syntax/json_PASS_3.json +0 -14
- package/tests/rules/ojcompjson/attrreq_FAIL_1/component.json +0 -69
- package/tests/rules/pack-compjson/audit-pack/component-1/component-1-view.html +0 -6
- package/tests/rules/pack-compjson/audit-pack/component-1/component-1-viewModel.js +0 -56
- package/tests/rules/pack-compjson/audit-pack/component-1/component.json +0 -13
- package/tests/rules/pack-compjson/audit-pack/component-1/loader.js +0 -20
- package/tests/rules/pack-compjson/audit-pack/component-1/resources/nls/component-1-strings.js +0 -18
- package/tests/rules/pack-compjson/audit-pack/component-2/component-2-view.html +0 -5
- package/tests/rules/pack-compjson/audit-pack/component-2/component-2-viewModel.js +0 -56
- package/tests/rules/pack-compjson/audit-pack/component-2/component.json +0 -13
- package/tests/rules/pack-compjson/audit-pack/component-2/loader.js +0 -20
- package/tests/rules/pack-compjson/audit-pack/component-2/resources/nls/component-1-strings.js +0 -18
- package/tests/rules/pack-compjson/audit-pack/component.json +0 -12
- package/tests/rules/pack-compjson/audit-singleton-1/audit-singleton-1-view.html +0 -5
- package/tests/rules/pack-compjson/audit-singleton-1/audit-singleton-1-viewModel.js +0 -56
- package/tests/rules/pack-compjson/audit-singleton-1/component.json +0 -20
- package/tests/rules/pack-compjson/audit-singleton-1/loader.js +0 -20
- package/tests/rules/pack-compjson/audit-singleton-1/resources/nls/audit-singleton-1-strings.js +0 -18
- package/tests/rules/pack-compjson/audit-singleton-2/audit-singleton-2-view.html +0 -8
- package/tests/rules/pack-compjson/audit-singleton-2/audit-singleton-2-viewModel.js +0 -56
- package/tests/rules/pack-compjson/audit-singleton-2/component.json +0 -15
- package/tests/rules/pack-compjson/audit-singleton-2/loader.js +0 -20
- package/tests/rules/pack-compjson/audit-singleton-2/resources/nls/audit-singleton-2-strings.js +0 -18
- package/tests/rules/parse-html/proc_instr.html +0 -9
- package/tests/rules/spoc-dom-manip/dom-manip_FAIL_1.js +0 -113
- package/tests/rules/spoc-dom-manip/dom-manip_FAIL_2.js +0 -151
- package/tests/rules/spoc-dom-manip/dom-manip_PASS_1.js +0 -149
- package/tests/rules/spoc-dom-manip/dom-manip_PASS_2.js +0 -147
- package/tests/rules/spoc-dom-manip/dom-manip_PASS_3.js +0 -147
- package/tests/rules/spoc-dom-manip/dom-manip_PASS_4.js +0 -20
- package/tests/rules/spoc-dom-manip/dom-manip_PASS_5.js +0 -246
- package/tests/rules/tab-tests/tab-test_FAIL_1.html +0 -37
- package/tests/rules/tab-tests/tab-test_FAIL_2.html +0 -8
- package/tests/rules/webcomptests/jet-composites/oj-html-wctag-$props/prop_PASS_1.html +0 -8
- package/tests/rules/webcomptests/jet-composites/oj-html-wctag-$props/prop_PASS_2.html +0 -8
- package/tests/rules/webcomptests/jet-composites/oj-html-wctag-for/for_FAIL_1.html +0 -8
- package/tests/rules/webcomptests/jet-composites/oj-html-wctag-for/for_PASS_1.html +0 -8
- package/tests/src/JetTest.js +0 -1
- package/tests/src/server.js +0 -1
- package/tests/test.js +0 -1
package/lib/CssLib.js
CHANGED
|
@@ -1 +1,6 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2018, 2022, Oracle and/or its affiliates.
|
|
3
|
+
* Licensed under The Universal Permissive License (UPL), Version 1.0
|
|
4
|
+
* as shown at https://oss.oracle.com/licenses/upl/
|
|
5
|
+
*/
|
|
1
6
|
const CSS=require("css-tree");var CssLib=function(nodeDeps,appCtx){this._ast=null;this._appCtx=appCtx;this._options={positions:true,parseCustomProperty:true,filename:" "};this._options.onParseError=this._onParseError.bind(this);this._listeners={}};CssLib.prototype.addListener=function(code,fn){this._listeners[code]=fn;return this};CssLib.prototype.parse=function(data,fname,pos){this._file=fname;this._error=false;this._pos=pos;this._ast=CSS.parse(data,this._options);if(this._error){var fn=this._listeners.error;if(fn){fn(this._error)}else{throw this._error}}CSS.toPlainObject(this._ast);this._walk()};CssLib.prototype._onNode=function(node,item,list){var fn=this._listeners[node.type];if(fn){fn(node,this._ast,list)}};CssLib.prototype._walk=function(){CSS.walk(this._ast,this._onNode.bind(this))};CssLib.prototype._onParseError=function(error){if(this._appCtx.verboseMode||this._appCtx.debugMode){if(this._file){console.log("File -> "+this._file)}let m=this.formatMsg(error);console.log("["+(error.line+this._pos.row-1)+", "+(error.column+this._pos.col-1)+"] : "+m)}if(!this._error){this._error=[]}this._error.push(error)};CssLib.prototype.formatMsg=function(err){var m,m2,a,l,i;a=err.formattedMessage.split("\n");m=a[0];if(err.name==="SyntaxError"){for(i=1;i<a.length;i++){l=a[i].trim();if(l.startsWith("----")){m2=a[i-1];if(m2){i=m2.indexOf("|");if(i>=0){m2=m2.substring(i+1)}m+=" (near: '"+m2.trim()+"')";break}}}}else{this._appCtx.assert("CSS PARSER - type = "+err.name+" ("+this._file+") ;")}return m};function _displayAst(obj,title){if(title){console.log("\n\n-----------------------");console.log(" "+title);console.log("-----------------------")}console.log(JSON.stringify(obj,null,4))};function _dumpSelector(node,indent){var a,i,sel,s;indent=indent||"";console.log(indent+node.type);a=node.children;for(i=0;i<a.length;i++){sel=a[i];s=indent+" "+sel.type+" ";if(sel.type==="TypeSelector"||sel.type==="IdSelector"||sel.type==="ClassSelector"||sel.type==="PseudoClassSelector"){console.log(s+"'"+sel.name+"'")}else{console.log(s+"'"+sel.value+"'")}}};module.exports=CssLib;
|
package/lib/CssUtils.js
CHANGED
|
@@ -1 +1,6 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2018, 2022, Oracle and/or its affiliates.
|
|
3
|
+
* Licensed under The Universal Permissive License (UPL), Version 1.0
|
|
4
|
+
* as shown at https://oss.oracle.com/licenses/upl/
|
|
5
|
+
*/
|
|
1
6
|
const NAMED_COLORS={"transparent":true,"black":true,"silver":true,"gray":true,"white":true,"maroon":true,"red":true,"purple":true,"fuchsia":true,"green":true,"lime":true,"olive":true,"yellow":true,"navy":true,"blue":true,"teal":true,"aqua":true,"orange":true,"aliceblue":true,"antiquewhite":true,"aquamarine":true,"azure":true,"beige":true,"bisque":true,"blanchedalmond":true,"blueviolet":true,"brown":true,"burlywood":true,"cadetblue":true,"chartreuse":true,"chocolate":true,"coral":true,"cornflowerblue":true,"cornsilk":true,"crimson":true,"cyan":true,"darkblue":true,"darkcyan":true,"darkgoldenrod":true,"darkgray":true,"darkgreen":true,"darkgrey":true,"darkkhaki":true,"darkmagenta":true,"darkolivegreen":true,"darkorange":true,"darkorchid":true,"darkred":true,"darksalmon":true,"darkseagreen":true,"darkslateblue":true,"darkslategray":true,"darkslategrey":true,"darkturquoise":true,"darkviolet":true,"deeppink":true,"deepskyblue":true,"dimgray":true,"dimgrey":true,"dodgerblue":true,"firebrick":true,"floralwhite":true,"forestgreen":true,"gainsboro":true,"ghostwhite":true,"gold":true,"goldenrod":true,"greenyellow":true,"grey":true,"honeydew":true,"hotpink":true,"indianred":true,"indigo":true,"ivory":true,"khaki":true,"lavender":true,"lavenderblush":true,"lawngreen":true,"lemonchiffon":true,"lightblue":true,"lightcoral":true,"lightcyan":true,"lightgoldenrodyellow":true,"lightgray":true,"lightgreen":true,"lightgrey":true,"lightpink":true,"lightsalmon":true,"lightseagreen":true,"lightskyblue":true,"lightslategray":true,"lightslategrey":true,"lightsteelblue":true,"lightyellow":true,"limegreen":true,"linen":true,"magenta":true,"mediumaquamarine":true,"mediumblue":true,"mediumorchid":true,"mediumpurple":true,"mediumseagreen":true,"mediumslateblue":true,"mediumspringgreen":true,"mediumturquoise":true,"mediumvioletred":true,"midnightblue":true,"mintcream":true,"mistyrose":true,"moccasin":true,"navajowhite":true,"oldlace":true,"olivedrab":true,"orangered":true,"orchid":true,"palegoldenrod":true,"palegreen":true,"paleturquoise":true,"palevioletred":true,"papayawhip":true,"peachpuff":true,"peru":true,"pink":true,"plum":true,"powderblue":true,"rosybrown":true,"royalblue":true,"saddlebrown":true,"salmon":true,"sandybrown":true,"seagreen":true,"seashell":true,"sienna":true,"skyblue":true,"slateblue":true,"slategray":true,"slategrey":true,"snow":true,"springgreen":true,"steelblue":true,"tan":true,"thistle":true,"tomato":true,"turquoise":true,"violet":true,"wheat":true,"whitesmoke":true,"yellowgreen":true,"rebeccapurple":true};const MARKER_STYLES={"oj-visited":true,"oj-disabled":true,"oj-enabled":true,"oj-read-only":true,"oj-invalid":true,"oj-warning":true,"oj-info":true,"oj-confirmation":true,"oj-required":true,"oj-indeterminate":true,"oj-active":true,"oj-selected":true,"oj-hover":true,"oj-focus":true,"oj-focus-only":true,"oj-focus-highlight":true,"oj-default":true,"oj-draggable":true,"oj-drag":true,"oj-drop":true,"oj-active-drop":true,"oj-valid-drop":true,"oj-invalid-drop":true,"oj-expanded":true,"oj-collapsed":true,"oj-right":true,"oj-center":true,"oj-left":true,"oj-start":true,"oj-end":true,"oj-top":true,"oj-middle":true,"oj-bottom":true,"oj-full-width":true,"oj-hicontrast":true,"oj-component":true,"oj-component-initnode":true,"oj-complete":true,"oj-animate-open":true,"oj-animate-open-active":true,"oj-animate-close":true,"oj-animate-close-active":true,"oj-animate-add":true,"oj-animate-add-active":true,"oj-animate-remove":true,"oj-animate-remove-active":true,"oj-animate-update":true,"oj-animate-update-active":true};function isColorName(s){return!!NAMED_COLORS[s.toLowerCase()]};function isMarkerStyle(style){return!!MARKER_STYLES[style]};function getPosition(ruleCtx,loc){var pos={};var start=loc.start;pos.line=start.line;pos.col=start.column;pos.startIndex=start.offset;pos.endIndex=loc.end.offset;pos.line+=ruleCtx.offset.row-1;pos.startIndex+=ruleCtx.offset.index;pos.endIndex+=ruleCtx.offset.index;return pos};module.exports={isColorName,isMarkerStyle,getPosition};
|
package/lib/DomUtils.js
CHANGED
|
@@ -1 +1,6 @@
|
|
|
1
|
-
const jsonParser=require('really-relaxed-json').createParser();const HtmlUtils=require('./HtmlUtils');const NodeType=require('./NodeTypes');const OJCOMPONENT='ojComponent';const COMPONENT='component';const SVG_PATH_COMMANDS=['M','m','L','I','H','h','V','v','C','c','S','s','Q','q','T','t','A','a','Z','z'];const DOT='.';const ON_DASH='on-';function DomUtils(nodeDeps,appContext,oTabs){this._tree=null;this._nodeDeps=nodeDeps;this._appContext=appContext;this._tabs=oTabs;this._utils=appContext.utils};DomUtils.prototype.getFirst=function(){return this._tree.length?this._tree[0]:null};DomUtils.prototype.getLast=function(){var node;node=this._tree.length?this._tree[this._tree.length-1]:null;while(node&&node.children&&node.children.length){node=node.children[node.children.length-1]}return node};DomUtils.prototype.getFirstElem=function(){var node=this.getFirst();while(node){if(node.type===NodeType.TAG){break};node=node.next}return node};DomUtils.prototype.getChildren=function(node){return node.children};DomUtils.prototype.getParent=function(node){return node.parent};DomUtils.prototype.getSiblings=function(node){var parent=this.getParent(node);if(parent){return this.getChildren(parent)}else{return this._tree}};DomUtils.prototype.getNext=function(node){return node.next||null};DomUtils.prototype.getAttribs=function(node){return node.attribs||null};DomUtils.prototype.getAttribValue=function(node,name){return node.attribs?node.attribs[name]:undefined};DomUtils.prototype.hasAttrib=function(node,name){return!!node.attribs&&hasOwnProperty.call(node.attribs,name)};DomUtils.prototype.hasChildren=function(node){return!!node.children};DomUtils.prototype.hasNext=function(node){return!!node.next};DomUtils.prototype.getName=function(node){return node.name};DomUtils.prototype.getType=function(node){return node.type};DomUtils.prototype.getElemsByName=function(name){var a=[],i,names;if(!this._tree){return a}names=typeof name==='string'?[name]:name;for(i=0;i<names.length;i++){names[i]=names[i].toLowerCase()}for(i=0;i<this._tree.length;i++){_getElemsByName2(this._tree[i],a,names)}return a};function _getElemsByName2(node,a,names){var children,i;if((node.type===NodeType.TAG||node.type===NodeType.SCRIPT)&&names.indexOf(node.name.toLowerCase())>=0){a.push(node)}if(node.children){children=node.children;for(i=0;i<children.length;i++){_getElemsByName2(children[i],a,names)}}};DomUtils.prototype.getElemById=function(id,labelId){var node,i;if(!this._tree){return null}for(i=0;i<this._tree.length;i++){node=this._tree[i];if(node.type===NodeType.TAG||_isHtmlScript(node)){node=this._getElemById2(node,id,labelId);if(node){return node}}}return null};DomUtils.prototype._getElemById2=function(node,id,labelId){var curNode,attrib,attr,attribLower,i;if((node.type===NodeType.TAG||_isHtmlScript(node))&&node.attribs){for(attrib in node.attribs){attribLower=attrib.toLowerCase();if(attribLower==='id'||labelId&&attribLower==='label-id'){if(node.attribs[attrib]===id){return node}}else if(attrib==='data-bind'){attr=this.extractAttribsFromDataBind(node.attribs[attrib]);if(attr&&attr['id']===id){return node}}}}if(node.children){for(i=0;i<node.children.length;i++){curNode=this._getElemById2(node.children[i],id,labelId);if(curNode){return curNode}}}return null};DomUtils.prototype.getElems=function(){var a=[],i;if(!this._tree){return a}for(i=0;i<this._tree.length;i++){_getElems2(this._tree[i],a)}return a};function _getElems2(node,a){var children,i;if(node.type===NodeType.TAG||node.type===NodeType.SCRIPT){a.push(node)}if(node.children){children=node.children;for(i=0;i<children.length;i++){_getElems2(children[i],a)}}};DomUtils.prototype.getComponentElems=function(){var a=[],i;if(!this._tree){return a}for(i=0;i<this._tree.length;i++){this._getComponentElems2(this._tree[i],a)}return a};DomUtils.prototype._getComponentElems2=function(node,a){var children,i;if(node.type===NodeType.TAG&&this._appContext.metaLib.isCCATag(node.name)){a.push(node)}if(node.children){children=node.children;for(i=0;i<children.length;i++){this._getComponentElems2(children[i],a)}}};DomUtils.prototype.isCommonAttr=function(attrName){attrName=attrName.toLowerCase();attrName=attrName.charAt(0)===':'?attrName.substr(1):attrName;return HtmlUtils.isCommonAttr(attrName)};DomUtils.prototype.isCommonEventAttr=function(attrName){attrName=attrName.toLowerCase();attrName=attrName.charAt(0)===':'?attrName.substr(1):attrName;if(attrName.startsWith('on-oj-')){return false}if(attrName.startsWith('on-')){attrName=attrName.substring(0,2)+attrName.substring(3)}return HtmlUtils.isCommonEventAttr(attrName)};DomUtils.prototype.isCommonElem=function(elem){return HtmlUtils.isCommonElem(elem)};DomUtils.prototype.isSvgElem=function(elem){return HtmlUtils.isSvgElem(elem)};DomUtils.prototype.isHtml5ObsoleteElem=function(tag){return HtmlUtils.isHtml5ObsoleteElem(tag)};DomUtils.prototype.isHtml5ObsoleteAttr=function(tagName,attrName){return HtmlUtils.isHtml5ObsoleteAttr(tagName,attrName)};DomUtils.prototype.isSelfClosingTag=function(tag){return HtmlUtils.isSelfClosingTag(tag)};DomUtils.prototype.isNamespaceTag=function(tagName){if(this._appContext.metaLib.isJetTag(tagName)){return true}return HtmlUtils.isNamespaceTag(tagName)};DomUtils.prototype.isNamespacePrefix=function(tagPrefix){return!!HtmlUtils.isNamespacePrefix(tagPrefix)};DomUtils.prototype.isChildOfElem=function(elemName,node){return!!this.isChildOfElemNode(elemName,node)};DomUtils.prototype.isChildOfElemNode=function(elemName,node){var ret=null;while(node.parent){if(node.parent.name===elemName){ret=node.parent;break}node=node.parent}return ret};DomUtils.prototype.getDataBindComponent=function(context){var node,val,attrVal,ret=null;node=context.tagNode;if(this.getAttribs(node)){attrVal=this.getAttribValue(node,'data-bind');if(attrVal){val=this.extractComponentFromDataBind(attrVal);if(val){ret='oj.'+val}}}return ret};DomUtils.prototype.getDataBindAttr=function(context){return this.getDataBindAttrsFromNode(context,context.node)};DomUtils.prototype.getDataBindAttrs=function(context){return this.getDataBindAttrsFromNode(context,context.node)};DomUtils.prototype.getDataBindAttrsFromNode=function(context,node){var attrVal,ret=null;if(this.getAttribs(node)){attrVal=this.getAttribValue(node,'data-bind');if(attrVal){ret=this.extractAttribsFromDataBind(attrVal)}}return ret};DomUtils.prototype.extractComponentFromDataBind=function(attrValue){var dataBind,componentName,x;x=attrValue.indexOf(OJCOMPONENT);if(x<0){return}componentName=null;if(attrValue.length>OJCOMPONENT.length){dataBind=attrValue.substring(x+OJCOMPONENT.length);x=dataBind.indexOf(COMPONENT);if(x>=0){dataBind=dataBind.substring(x+COMPONENT.length).trim();if(dataBind.charAt(0)===':'){x=dataBind.indexOf('oj');if(x>=0){dataBind=dataBind.substring(x);componentName=_extractComponentName(dataBind,this._utils)}}}}return componentName};function _extractComponentName(s,utils){var componentName,i,c;for(i=0;i<s.length;i++){c=s.charAt(i);if(c==='\''||c==='"'||utils.isWhitespace(c)){componentName=s.substring(0,i);break}}return componentName};DomUtils.prototype.extractAttribsFromDataBind=function(attrValue){var s,a,nextAttr,val,i,j,x,ret=null;if(attrValue.indexOf(':')<0){return ret}a=attrValue.split('attr');if(a.length<2){return ret}for(i=0;i<a.length;i++){a[i]=s=a[i].trim();if(s.charAt(0)===':'){s=s.substr(1).trim();if(s.charAt(0)==='{'){try{ret=jsonParser.stringToJson(s);ret=JSON.parse(ret)}catch(e){s=s.substring(1).trim();a=s.split(':');for(j=0;j<a.length;j++){if(nextAttr){if(!ret){ret={}}ret[nextAttr]=val=a[j].replace(/['\"]/g,'').trim();x=val.lastIndexOf('}');if(x>=0){ret[nextAttr]=val.substring(0,x).trim();break}nextAttr=null}if(j+1===a.length){break}a[j]=s=a[j].trim();s=s.replace(/['\"]/g,'').trim();if(s.length===0)continue;if(!ret){ret={}}ret[s]=val=a[++j].trim();x=val.indexOf(',');if(x>=0){ret[s]=val.substring(0,x).replace(/['\"]/g,'').trim();nextAttr=val.substring(x+1).trim();nextAttr=nextAttr.replace(/['\"]/g,'').trim();val=val.substring(0,x).replace(/['\"]/g,'').trim()}else{ret[s]=val.replace(/['\"]/g,'').trim()}x=val.lastIndexOf('}');if(x>=0){ret[s]=val.substring(0,x).trim();break}}}}break}}return ret};DomUtils.prototype.getAttrPosition=function(data,node,attrName){var startIndex=this.getAttrIndex(data,node,attrName);var endIndex=startIndex+attrName.length-1;var rowCol=this._utils.getRowColFromIndex(data,startIndex,'html');rowCol.start=startIndex;rowCol.end=endIndex;return rowCol};DomUtils.prototype.getAttrIndex=function(data,node,attrName){var attribs,index,temp,c,i,isQuote=attrName==='"'||attrName==='\'';attribs=node.attribs;if(!attribs){this._appContext.assert('no attrs in tag '+node.name+'(expected attr \''+attrName+')');return node.startIndex}if(!attribs.hasOwnProperty(attrName)&&!attribs.hasOwnProperty(':'+attrName)){this._appContext.assert('expected attr \''+attrName+'\' in tag '+node.name);return node.startIndex}index=data.indexOf(attrName,node.startIndex);while(true){index=data.indexOf(attrName,index);if(index>=0){temp=data.substring(index+attrName.length,index+100);i=this._utils.eatWhitespace(temp);if(i<0){return node.startIndex}c=temp.charAt(i);if(c==='='||c==='>'||!isQuote&&this._utils.isWhitespace(temp.charAt(0))){return index}index+=i+1;continue}this._appContext.assert('expected attr \''+attrName+'\' in tag '+node.name);return node.startIndex}};DomUtils.prototype.isNonFragmentJetPage=function(context){return this.hasBody(context)&&this.isJetPage(context)};DomUtils.prototype.hasBody=function(context){var i,siblings,ret=false;siblings=this.getSiblings(context.node);for(i=0;i<siblings.length;i++){if(this._hasBody2(siblings[i])){ret=true;break}}return ret};DomUtils.prototype._hasBody2=function(node){var i,children,ret=false;if(node.type===NodeType.TAG&&node.name.toLowerCase()==='body'){return true}if(node.children){children=node.children;for(i=0;i<children.length;i++){if(this._hasBody2(children[i])){ret=true;break}}}return ret};DomUtils.prototype.isJetPage=function(context){var i,siblings,ret=false;siblings=this.getSiblings(context.node);for(i=0;i<siblings.length;i++){if(this._isJetPage2(siblings[i])){ret=true;break}}return ret};DomUtils.prototype._isJetPage2=function(node){var i,children,ret=false;if(node.type===NodeType.TAG&&node.name.toLowerCase().startsWith('oj-')){return true}if(node.children){children=node.children;for(i=0;i<children.length;i++){if(this._isJetPage2(children[i])){ret=true;break}}}return ret};DomUtils.prototype.isValidJson=function(value,data){var data,ret;if(value.charAt(0)!=='{'){return true}try{data=JSON.parse(this._nodeDeps.decomment(value));ret=!!data}catch(e){if(typeof data==='string'&&e.toString().startsWith('SyntaxError')){var obj=_convertMsgToRowCol(e.message,data,this._utils);ret.msg=obj.msg;ret.line=obj.row;ret.col=obj.col;ret.position=obj.position}else{ret=e.message}}return ret};DomUtils.prototype.isAttrExprConstant=function(expr){return HtmlUtils.isAttrExprConstant(expr)};DomUtils.prototype.isSvgPath=function(s){var c=s.trim().charAt(0);return SVG_PATH_COMMANDS.indexOf(c)>=0};DomUtils.prototype.camelCase=function(str){var parts,i;function _camelCase(str){return str.replace(/(?:^\w|[A-Z]|\b\w)/g,function(word,index){return index==0?word.toLowerCase():word.toUpperCase()}).replace(/-|\s+/g,'')};parts=str.split(DOT);for(i=0;i<parts.length;i++){parts[i]=_camelCase(parts[i])}return parts.join(DOT)};DomUtils.prototype.kebabCase=function(str){return str.replace(/([a-zA-Z])(?=[A-Z])/g,'$1-').toLowerCase()};DomUtils.prototype.kekabCaseEvent=function(str){return ON_DASH+this.kebabCase(str)};function _isHtmlScript(node){var attribs=node.attribs;return node.type&&node.type===NodeType.SCRIPT&&attribs&&attribs.type&&attribs.type.indexOf('html')>=0};function _convertMsgToRowCol(msg,data,utils){var x,n,obj;x=msg.indexOf('position');if(x<0){return null}n=parseInt(msg.substr(x+8).trim());obj=utils.getRowColFromIndex(data,n);obj.msg=msg.substr(0,x)+'line '+obj.row+', col '+obj.col+' (position '+n+')';obj.position=n;return obj};DomUtils.prototype.setDom=function(oDom){this._tree=oDom};module.exports=DomUtils;
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2018, 2022, Oracle and/or its affiliates.
|
|
3
|
+
* Licensed under The Universal Permissive License (UPL), Version 1.0
|
|
4
|
+
* as shown at https://oss.oracle.com/licenses/upl/
|
|
5
|
+
*/
|
|
6
|
+
const jsonParser=require('really-relaxed-json').createParser();const HtmlUtils=require('./HtmlUtils');const NodeType=require('./NodeTypes');const OJCOMPONENT='ojComponent';const COMPONENT='component';const SVG_PATH_COMMANDS=['M','m','L','I','H','h','V','v','C','c','S','s','Q','q','T','t','A','a','Z','z'];const DOT='.';const ON_DASH='on-';function DomUtils(nodeDeps,appContext,oTabs,fileIndex){this._tree=null;this._nodeDeps=nodeDeps;this._appContext=appContext;this._tabs=oTabs;this._utils=appContext.utils;this._fileIndex=fileIndex};DomUtils.prototype.getFirst=function(){return this._tree.length?this._tree[0]:null};DomUtils.prototype.getLast=function(){var node;node=this._tree.length?this._tree[this._tree.length-1]:null;while(node&&node.children&&node.children.length){node=node.children[node.children.length-1]}return node};DomUtils.prototype.getFirstElem=function(){var node=this.getFirst();while(node){if(node.type===NodeType.TAG){break};node=node.next}return node};DomUtils.prototype.getChildren=function(node){return node.children};DomUtils.prototype.getParent=function(node){return node.parent};DomUtils.prototype.getSiblings=function(node){var parent;if(parent=this.getParent(node)){return this.getChildren(parent)}else{return this._tree}};DomUtils.prototype.getNext=function(node){return node.next||null};DomUtils.prototype.getAttribs=function(node){return node.attribs||null};DomUtils.prototype.getAttribValue=function(node,name){return node.attribs?node.attribs[name]:undefined};DomUtils.prototype.getAttribRawValue=function(ruleCtx,name){var val,pos;if(ruleCtx.tagNode.attribs){if(typeof(val=ruleCtx.tagNode.attribs[name])==='string'){pos=this.getAttrPosition(ruleCtx.data,ruleCtx.tagNode,name);return _getAttrRawValue(ruleCtx.data,pos.start,name,val,ruleCtx.utils.utils)}}};DomUtils.prototype.hasAttrib=function(node,name){return!!node.attribs&&hasOwnProperty.call(node.attribs,name)};DomUtils.prototype.hasChildren=function(node){return!!node.children};DomUtils.prototype.hasNext=function(node){return!!node.next};DomUtils.prototype.getName=function(node){return node.name};DomUtils.prototype.getType=function(node){return node.type};DomUtils.prototype.getElemsByName=function(name){var a=[],i,names;if(!this._tree){return a}names=typeof name==='string'?[name]:name;for(i=0;i<names.length;i++){names[i]=names[i].toLowerCase()}for(i=0;i<this._tree.length;i++){_getElemsByName2(this._tree[i],a,names)}return a};function _getElemsByName2(node,a,names){var children,i;if((node.type===NodeType.TAG||node.type===NodeType.SCRIPT)&&names.indexOf(node.name.toLowerCase())>=0){a.push(node)}if(node.children){children=node.children;for(i=0;i<children.length;i++){_getElemsByName2(children[i],a,names)}}};DomUtils.prototype.getElemById=function(id,labelId){var node,i;if(!this._tree){return null}for(i=0;i<this._tree.length;i++){node=this._tree[i];if(node.type===NodeType.TAG||_isHtmlScript(node)){node=this._getElemById2(node,id,labelId);if(node){return node}}}return null};DomUtils.prototype._getElemById2=function(node,id,labelId){var curNode,attrib,attr,attribLower,i;if((node.type===NodeType.TAG||_isHtmlScript(node))&&node.attribs){for(attrib in node.attribs){attribLower=attrib.toLowerCase();if(attribLower==='id'||labelId&&attribLower==='label-id'){if(node.attribs[attrib]===id){return node}}else if(attrib==='data-bind'){attr=this.extractAttribsFromDataBind(node.attribs[attrib]);if(attr&&attr['id']===id){return node}}}}if(node.children){for(i=0;i<node.children.length;i++){curNode=this._getElemById2(node.children[i],id,labelId);if(curNode){return curNode}}}return null};DomUtils.prototype.getElems=function(){var a=[],i;if(!this._tree){return a}for(i=0;i<this._tree.length;i++){_getElems2(this._tree[i],a)}return a};function _getElems2(node,a){var children,i;if(node.type===NodeType.TAG||node.type===NodeType.SCRIPT){a.push(node)}if(node.children){children=node.children;for(i=0;i<children.length;i++){_getElems2(children[i],a)}}};DomUtils.prototype.getScripts=function(){var head,ch,a=[];if(head=this.getHead()){if(ch=head.children){ch.forEach(elem=>{if(elem.type===NodeType.TAG&&elem.name==='script'){a.push(elem)}})}}return a};DomUtils.prototype.getLinks=function(){var head,ch,a=[];if(head=this.getHead()){if(ch=head.children){ch.forEach(elem=>{if(elem.type===NodeType.TAG&&elem.name==='link'){a.push(elem)}})}}return a};DomUtils.prototype.getHead=function(){var elem,ch,i;if(!this._tree){return null}for(i=0;i<this._tree.length;i++){elem=this._tree[i];if(elem.type===NodeType.TAG&&elem.name==='html'){if(ch=elem.children){for(i=0;i<ch.length;i++){elem=ch[i];if(elem.type===NodeType.TAG&&elem.name==='head'){return elem}}}break}}return null};DomUtils.prototype.getBody=function(){var elem,ch,i;if(!this._tree){return null}for(i=0;i<this._tree.length;i++){elem=this._tree[i];if(elem.type===NodeType.TAG&&elem.name==='html'){if(ch=elem.children){for(i=0;i<ch.length;i++){elem=ch[i];if(elem.type===NodeType.TAG&&elem.name==='body'){return elem}}}break}}return null};DomUtils.prototype.getComponentElems=function(){var a=[],i;if(!this._tree){return a}for(i=0;i<this._tree.length;i++){this._getComponentElems2(this._tree[i],a)}return a};DomUtils.prototype._getComponentElems2=function(node,a){var children,i;if(node.type===NodeType.TAG&&this._appContext.metaLib.isWCTag(node.name)){a.push(node)}if(node.children){children=node.children;for(i=0;i<children.length;i++){this._getComponentElems2(children[i],a)}}};DomUtils.prototype.isCommonAttr=function(attrName){attrName=attrName.toLowerCase();attrName=attrName.charAt(0)===':'?attrName.substr(1):attrName;return HtmlUtils.isCommonAttr(attrName)};DomUtils.prototype.isCommonEventAttr=function(attrName){attrName=attrName.toLowerCase();attrName=attrName.charAt(0)===':'?attrName.substr(1):attrName;if(attrName.startsWith('on-oj-')){return false}if(attrName.startsWith('on-')){attrName=attrName.substring(0,2)+attrName.substring(3)}return HtmlUtils.isCommonEventAttr(attrName)};DomUtils.prototype.isCommonElem=function(elem){return HtmlUtils.isCommonElem(elem)};DomUtils.prototype.isSvgElem=function(elem){return HtmlUtils.isSvgElem(elem)};DomUtils.prototype.isHtml5ObsoleteElem=function(tag){return HtmlUtils.isHtml5ObsoleteElem(tag)};DomUtils.prototype.isHtml5ObsoleteAttr=function(tagName,attrName){return HtmlUtils.isHtml5ObsoleteAttr(tagName,attrName)};DomUtils.prototype.isSelfClosingTag=function(tag){return HtmlUtils.isSelfClosingTag(tag)};DomUtils.prototype.isNamespaceTag=function(tagName){if(this._appContext.metaLib.isJetTag(tagName)){return true}return HtmlUtils.isNamespaceTag(tagName)};DomUtils.prototype.isNamespacePrefix=function(tagPrefix){return!!HtmlUtils.isNamespacePrefix(tagPrefix)};DomUtils.prototype.isChildOfElem=function(elemName,node){return!!this.isChildOfElemNode(elemName,node)};DomUtils.prototype.isChildOfElemNode=function(elemName,node){var ret=null;while(node.parent){if(node.parent.name===elemName){ret=node.parent;break}node=node.parent}return ret};DomUtils.prototype.getDataBindComponent=function(context){var node,val,attrVal,ret=null;node=context.tagNode;if(this.getAttribs(node)){attrVal=this.getAttribValue(node,'data-bind');if(attrVal){val=this.extractComponentFromDataBind(attrVal);if(val){ret='oj.'+val}}}return ret};DomUtils.prototype.getDataBindAttr=function(context){return this.getDataBindAttrsFromNode(context,context.node)};DomUtils.prototype.getDataBindAttrs=function(context){return this.getDataBindAttrsFromNode(context,context.node)};DomUtils.prototype.getDataBindAttrsFromNode=function(context,node){var attrVal,ret=null;if(this.getAttribs(node)){attrVal=this.getAttribValue(node,'data-bind');if(attrVal){ret=this.extractAttribsFromDataBind(attrVal)}}return ret};DomUtils.prototype.extractComponentFromDataBind=function(attrValue){var dataBind,componentName,x;x=attrValue.indexOf(OJCOMPONENT);if(x<0){return}componentName=null;if(attrValue.length>OJCOMPONENT.length){dataBind=attrValue.substring(x+OJCOMPONENT.length);x=dataBind.indexOf(COMPONENT);if(x>=0){dataBind=dataBind.substring(x+COMPONENT.length).trim();if(dataBind.charAt(0)===':'){x=dataBind.indexOf('oj');if(x>=0){dataBind=dataBind.substring(x);componentName=_extractComponentName(dataBind,this._utils)}}}}return componentName};function _extractComponentName(s,utils){var componentName,i,c;for(i=0;i<s.length;i++){c=s.charAt(i);if(c==='\''||c==='"'||utils.isWhitespace(c)){componentName=s.substring(0,i);break}}return componentName};DomUtils.prototype.extractAttribsFromDataBind=function(attrValue){var s,a,nextAttr,val,i,j,x,ret=null;if(attrValue.indexOf(':')<0){return ret}a=attrValue.split('attr');if(a.length<2){return ret}for(i=0;i<a.length;i++){a[i]=s=a[i].trim();if(s.charAt(0)===':'){s=s.substr(1).trim();if(s.charAt(0)==='{'){try{ret=jsonParser.stringToJson(s);ret=JSON.parse(ret)}catch(e){s=s.substring(1).trim();a=s.split(':');for(j=0;j<a.length;j++){if(nextAttr){if(!ret){ret={}}ret[nextAttr]=val=a[j].replace(/['\"]/g,'').trim();x=val.lastIndexOf('}');if(x>=0){ret[nextAttr]=val.substring(0,x).trim();break}nextAttr=null}if(j+1===a.length){break}a[j]=s=a[j].trim();s=s.replace(/['\"]/g,'').trim();if(s.length===0)continue;if(!ret){ret={}}ret[s]=val=a[++j].trim();x=val.indexOf(',');if(x>=0){ret[s]=val.substring(0,x).replace(/['\"]/g,'').trim();nextAttr=val.substring(x+1).trim();nextAttr=nextAttr.replace(/['\"]/g,'').trim();val=val.substring(0,x).replace(/['\"]/g,'').trim()}else{ret[s]=val.replace(/['\"]/g,'').trim()}x=val.lastIndexOf('}');if(x>=0){ret[s]=val.substring(0,x).trim();break}}}}break}}return ret};DomUtils.prototype.getAttrPosition=function(data,node,attrName){var startIndex=this.getAttrIndex(data,node,attrName);var endIndex=startIndex+attrName.length-1;var rowCol=this._utils.getRowColFromIndex(data,startIndex,'html');rowCol.start=startIndex;rowCol.end=endIndex;return rowCol};DomUtils.prototype.getAttrValuePosition=function(data,node,attrName){var attrPos,pos,endPos,ws,ret,good;var isDouble,isSingle,isUnquoted;attrPos=this.getAttrPosition(data,node,attrName);if(!attrPos||attrPos.start===node.startIndex){return}if((pos=this._utils.eatWhitespace(data,attrPos.end+1))>=0){if(data.charAt(pos++)==='='){if((endPos=this._utils.eatWhitespace(data,pos))>=0){isDouble=data.charAt(endPos)==='"';isSingle=data.charAt(endPos)==='\'';isUnquoted=!(isSingle||isDouble);if(isDouble){if((endPos=data.indexOf('"',pos+1))>=0){good=true}}else if(isSingle){if((endPos=data.indexOf('\'',pos+1))>=0){good=true}}else if(isUnquoted){ws=this._utils.getIndexToWhitespace(data,pos);endPos=data.indexOf('>',pos);if(ws>=0&&endPos>=0){endPos=(endPos<ws?endPos:ws)-1;good=true}}if(good){attrPos=this.getLineCol(data,pos);ret={row:attrPos.row,col:attrPos.col,start:pos,end:endPos}}}}}return ret};DomUtils.prototype.getLineCol=function(data,index){return this._fileIndex.getRowCol(data,{start:index},'html')};DomUtils.prototype.getAttrIndex=function(data,node,attrName){var attribs,index,temp,c,i,isQuote=attrName==='"'||attrName==='\'';attribs=node.attribs;if(!attribs){this._appContext.assert('no attrs in tag '+node.name+'(expected attr \''+attrName+')');return node.startIndex}if(!attribs.hasOwnProperty(attrName)&&!attribs.hasOwnProperty(':'+attrName)){this._appContext.assert('expected attr \''+attrName+'\' in tag '+node.name);return node.startIndex}index=data.indexOf(attrName,node.startIndex);while(true){index=data.indexOf(attrName,index);if(index>=0){temp=data.substring(index+attrName.length,index+100);i=this._utils.eatWhitespace(temp);if(i<0){return node.startIndex}c=temp.charAt(i);if(c==='='||c==='>'||!isQuote&&this._utils.isWhitespace(temp.charAt(0))){return index}index+=i+1;continue}this._appContext.assert('expected attr \''+attrName+'\' in tag '+node.name);return node.startIndex}};DomUtils.prototype.isNonFragmentJetPage=function(context){return this.hasBody(context)&&this.isJetPage(context)};DomUtils.prototype.hasBody=function(context){var i,siblings,ret=false;siblings=this.getSiblings(context.node);for(i=0;i<siblings.length;i++){if(this._hasBody2(siblings[i])){ret=true;break}}return ret};DomUtils.prototype._hasBody2=function(node){var i,children,ret=false;if(node.type===NodeType.TAG&&node.name.toLowerCase()==='body'){return true}if(node.children){children=node.children;for(i=0;i<children.length;i++){if(this._hasBody2(children[i])){ret=true;break}}}return ret};DomUtils.prototype.isJetPage=function(context){var i,siblings,ret=false;siblings=this.getSiblings(context.node);for(i=0;i<siblings.length;i++){if(this._isJetPage2(siblings[i])){ret=true;break}}return ret};DomUtils.prototype._isJetPage2=function(node){var i,children,ret=false;if(node.type===NodeType.TAG&&node.name.toLowerCase().startsWith('oj-')){return true}if(node.children){children=node.children;for(i=0;i<children.length;i++){if(this._isJetPage2(children[i])){ret=true;break}}}return ret};DomUtils.prototype.isValidJson=function(value,data){var data,ret;if(value.charAt(0)!=='{'){return true}try{data=JSON.parse(this._nodeDeps.decomment(value));ret=!!data}catch(e){if(typeof data==='string'&&e.toString().startsWith('SyntaxError')){var obj=_convertMsgToRowCol(e.message,data,this._utils);ret.msg=obj.msg;ret.line=obj.row;ret.col=obj.col;ret.position=obj.position}else{ret=e.message}}return ret};DomUtils.prototype.isAttrExprConstant=function(expr){return HtmlUtils.isAttrExprConstant(expr)};const RE_EXPRESSION=/^(?:\[{2})(.*)(?:\]{2})$|^(?:\{{2})(.*)(?:\}{2})$/;DomUtils.prototype.isExpression=function(s){var ret=false;if(s){ret=RE_EXPRESSION.test(s.trim())}return ret};DomUtils.prototype.getExpression=function(s){var ret=null;if(this.isExpression(s)){ret=s.substring(2,s.length-2).trim()}return ret};DomUtils.prototype.isSvgPath=function(s){var c=s.trim().charAt(0);return SVG_PATH_COMMANDS.indexOf(c)>=0};DomUtils.prototype.camelCase=function(str){var parts,i;function _camelCase(str){return str.replace(/(?:^\w|[A-Z]|\b\w)/g,function(word,index){return index==0?word.toLowerCase():word.toUpperCase()}).replace(/-|\s+/g,'')};parts=str.split(DOT);for(i=0;i<parts.length;i++){parts[i]=_camelCase(parts[i])}return parts.join(DOT)};DomUtils.prototype.kebabCase=function(str){return str.replace(/([a-zA-Z])(?=[A-Z])/g,'$1-').toLowerCase()};DomUtils.prototype.kekabCaseEvent=function(str){return ON_DASH+this.kebabCase(str)};function _isHtmlScript(node){var attribs=node.attribs;return node.type&&node.type===NodeType.SCRIPT&&attribs&&attribs.type&&attribs.type.indexOf('html')>=0};function _convertMsgToRowCol(msg,data,utils){var x,n,obj;x=msg.indexOf('position');if(x<0){return null}n=parseInt(msg.substr(x+8).trim());obj=utils.getRowColFromIndex(data,n);obj.msg=msg.substr(0,x)+'line '+obj.row+', col '+obj.col+' (position '+n+')';obj.position=n;return obj};function _getAttrRawValue(data,index,attrName,attrValue,utils){var ret=null,delim,i;i=index+attrName.length;if(data.charAt(i)==='='){i=utils.eatWhitespace(data,i+1);delim=data.substr(i,1);delim=delim==='\''||delim==='"'?delim:'"';ret=delim+attrValue+data.charAt(i+attrValue.length+1)}else{ret=attrValue}return ret};DomUtils.prototype.setDom=function(oDom){this._tree=oDom};module.exports=DomUtils;
|
package/lib/FileIndex.js
CHANGED
|
@@ -1 +1,6 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2018, 2022, Oracle and/or its affiliates.
|
|
3
|
+
* Licensed under The Universal Permissive License (UPL), Version 1.0
|
|
4
|
+
* as shown at https://oss.oracle.com/licenses/upl/
|
|
5
|
+
*/
|
|
1
6
|
var FileIndex=function(utils){this._displacements=[];this._lastDisp=null;this._utils=utils};FileIndex.prototype.getRowCol=function(data,index,fileType){var start,end,datalen,disp,lastDisp,c,inStart=false,latest,temp,initIndex,i;if(index.line){return{row:index.line,col:index.col}}if(!data){return{row:0,col:0}}start=index.start;end=index.end;datalen=data.length;lastDisp=null;latest=0;for(i=0;i<this._displacements.length;i++){disp=this._displacements[i];if(start>=disp.index&&disp.index>latest){lastDisp=disp;latest=disp.index}}if(lastDisp){if(start===lastDisp.index){return{row:lastDisp.line,col:lastDisp.col}}temp={index:lastDisp.index,line:lastDisp.line,col:lastDisp.col};lastDisp=temp}else{lastDisp={index:0,line:1,col:1}}initIndex=lastDisp.index;for(i=initIndex;i<datalen;i++){c=data.charAt(i);if(i===start){inStart=true;lastDisp.index=start;break}if(c==='\n'){lastDisp.line++;lastDisp.col=1;continue}if(c==='\r'){continue}if(!inStart){if(c!=='\t'){lastDisp.col++}else{lastDisp.col=this._tabs.getTabCol(lastDisp.col,fileType)}continue}}this._displacements.push(lastDisp);return{row:lastDisp.line,col:lastDisp.col}};FileIndex.prototype.clear=function(){this._displacements.length=0};FileIndex.prototype.setTabHandler=function(oTabs){this._tabs=oTabs};module.exports=FileIndex;
|
package/lib/FileSet.js
CHANGED
|
@@ -1 +1,6 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2018, 2022, Oracle and/or its affiliates.
|
|
3
|
+
* Licensed under The Universal Permissive License (UPL), Version 1.0
|
|
4
|
+
* as shown at https://oss.oracle.com/licenses/upl/
|
|
5
|
+
*/
|
|
1
6
|
function FileSet(nd){this._contentStack=null;this._contentStackIndex=-1;this._srcStack=null;this._srcStackIndex=-1;this._globOpts=null;this._fileErrorCount=0;this._info=null;this._nd=nd};FileSet.prototype.setFiles=function(files,excludes,msgCtx){this._srcStack=files;this._globOpts=addGlobIgnoreOpts(this._globOpts,excludes);this._contentStack=null;this._contentStackIndex=-1;this._srcStackIndex=-1;this._fileErrorCount=0;if(msgCtx){this._info=msgCtx.info}};FileSet.prototype.getFiles=function(){if(this._srcStack){return{files:this._srcStack,exclude:this._globOpts.ignore}}};FileSet.prototype.getFileErrorCount=function(){return this._fileErrorCount};FileSet.prototype.getNextFile=function(){var path,ft,files,i;if(this._contentStack){for(i=this._contentStackIndex+1;i<this._contentStack.length;i++){path=this._contentStack[i];if(!path){continue}this._contentStackIndex=i;ft=this._nd.fsUtils.getFileType(path);if(ft==='f'){if(i+1>=this._contentStack.length){this._contentStack=null;this._contentStackIndex=-1}return path}else if(ft==='?'){this._info('** File \''+path+'\' : ignored');this._fileErrorCount++}}}for(i=this._srcStackIndex+1;i<this._srcStack.length;i++){path=this._srcStack[i];this._srcStackIndex++;if(typeof path==='object'){return path}if(!path.startsWith('http')){if(this._globOpts){files=this._nd.glob.sync(path,this._globOpts)}else{files=this._nd.glob.sync(path)}if(this._removeDirs(files)){this._contentStack=files;this._contentStackIndex=-1;return this.getNextFile()}}else{return path}}return null};function addGlobIgnoreOpts(opts,excludes){if(!excludes||excludes.length===0){return opts}if(!opts){opts={}}opts.ignore=excludes;return opts};FileSet.prototype._removeDirs=function(ar){var i,ft,count=0;for(i=0;i<ar.length;i++){ft=this._nd.fsUtils.getFileTypeWithMsg(ar[i]);if(ft==='d'){ar[i]=null;continue}count++}return count};module.exports=FileSet;
|
package/lib/FsUtils.js
CHANGED
|
@@ -1 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2018, 2022, Oracle and/or its affiliates.
|
|
3
|
+
* Licensed under The Universal Permissive License (UPL), Version 1.0
|
|
4
|
+
* as shown at https://oss.oracle.com/licenses/upl/
|
|
5
|
+
*/
|
|
6
|
+
var nodeDeps,Utils;const tmpFile=require('tmp');function getFileType(path){var stats,ret;try{stats=nodeDeps.fs.statSync(path);if(stats.isFile()){ret='f'}else if(stats.isDirectory()){ret='d'}}catch(e){ret=e}return ret};function getFileTypeWithMsg(path){var ret;ret=getFileType(path);if(ret!=='f'&&ret!=='d'){if(ret.message.startsWith('ENOENT:')){console.log('\n** File "'+path+'" not found')}else{console('\n** File "'+path+'" error.\n'+' '+ret.message+'.\n')}ret='?'}return ret};function getFileExt(path){var s;try{if(!isSymLink(path)){s=nodeDeps.path.extname(path)}else{let p=nodeDeps.fs.readlinkSync(path);if(p){s=nodeDeps.path.extname(p)}}if(s&&s.charAt(0)==='.'){s=s.substring(1)}return s}catch(e){}return''};function isSymLink(path){var stats;try{stats=nodeDeps.fs.lstatSync(path);return stats.isSymbolicLink()}catch(e){}return false};function fileExists(filepath,dir){var stats,ret=false;try{stats=nodeDeps.fs.lstatSync(filepath);ret=dir?stats.isDirectory():stats.isFile()}catch(e){}return ret};function pathExistsSync(filepath){try{return nodeDeps.fs.existsSync(filepath)}catch(e){}return false};function readDir(path){var ret=[];try{_readDir(path,ret)}catch(e){ret=null}return ret};function _readDir(dir,ar){var files,file,filePath,stat,arDir,i;files=nodeDeps.fs.readdirSync(dir);for(i=0;i<files.length;i++){file=files[i];if(file[0]==='.'){continue}filePath=nodeDeps.path.join(dir,file);stat=nodeDeps.fs.statSync(filePath);if(stat.isFile()){ar.push({name:file,isFile:true})}else if(stat.isDirectory()){arDir=[];ar.push({name:file,isFile:false,files:arDir});_readDir(filePath,arDir)}}};function createFolder(dirPath,orig){var rc;dirPath=nodeDeps.path.resolve(dirPath);if(!orig){orig=dirPath}try{if(!nodeDeps.fs.statSync(dirPath).isDirectory()){return new Error(dirPath+' exists but is not a directory')}}catch(err){if(err.code==='ENOENT'){var np=nodeDeps.path.dirname(dirPath);if(np===dirPath){return new Error(orig+' cannot be created')}rc=createFolder(np,orig);if(typeof rc!=='boolean'){return rc}nodeDeps.fs.mkdirSync(dirPath);if(dirPath===orig){return true}}else{return err}}return true};function deleteFolder(filepath,deleteTarget){if(nodeDeps.fs.existsSync(filepath)){nodeDeps.fs.readdirSync(filepath).forEach(function(file){var curPath=nodeDeps.path.join(filepath,file);if(nodeDeps.fs.lstatSync(curPath).isDirectory()){deleteFolder(curPath,true)}else{nodeDeps.fs.unlinkSync(curPath)}});if(deleteTarget){nodeDeps.fs.rmdirSync(filepath)}}};function getUniqueFileName(template,targetFolder){const opts={template:template};if(targetFolder){opts.dir=targetFolder}return tmpFile.tmpNameSync(opts)};function findFile(dir,name,fncb){var ret;try{ret=_findFile(dir,name,fncb)}catch(e){}return ret};function _findFile(dir,name,fncb){var files,file,filePath,stat,ret,i;files=nodeDeps.fs.readdirSync(dir);for(i=0;i<files.length;i++){file=files[i];if(!fncb||fncb(dir,file)){if(file===name){return dir}}if(file[0]==='.'){continue}filePath=nodeDeps.path.join(dir,file);stat=nodeDeps.fs.statSync(filePath);if(stat.isDirectory()){ret=_findFile(filePath,name,fncb);if(ret){return ret}}}return null};function readFileSync(filePath,error){return _readFileSync(filePath,false,error)};function readFileBufSync(filePath,error){return _readFileSync(filePath,true,error)};function _readFileSync(filePath,wantBuffer,error){var haveFn,doThrow,noThrow,t;t=typeof error;doThrow=t==='boolean'&&error;noThrow=t==='boolean'&&!error;haveFn=t==='function';try{return wantBuffer?nodeDeps.fs.readFileSync(filePath):nodeDeps.fs.readFileSync(filePath,'utf8')}catch(e){function _prepErr(){var s=e.message;if(s.startsWith('ENOENT')){s=`ENOENT: file not found - '${filePath}'`}return s}if(haveFn){error(_prepErr())}else if(doThrow){throw new Error(e)}else if(noThrow){return _prepErr()}}return null};function readJsonSync(filepath,comments,error){var e,haveFn,doThrow,noThrow,t;t=typeof error;doThrow=t==='boolean'&&error;noThrow=t==='boolean'&&!error;haveFn=t==='function';var _fn=function(err){err='SYNTAX: '+err;e=err;if(haveFn){error(err)}};filepath=makeAbsolutePath(filepath);var o=nodeDeps.jsonLoader.load(filepath,nodeDeps,_fn,comments,Utils);if(e){if(doThrow){throw new Error(e)}else if(noThrow){return e}return null}if(o){return o}let msg='NOFILE: '+filepath;if(doThrow){throw new Error(msg)}if(noThrow){return msg}if(haveFn){error(msg)}return null};function writeJsonSync(obj,filepath,opts,error){var repl,ind,err;var doThrow,noThrow,haveFn,t;t=typeof error;doThrow=t==='boolean'&&error;noThrow=t==='boolean'&&!error;haveFn=t==='function';if(opts){repl=opts.replacer?opts.replacer:null;ind=opts.spaces}filepath=makeAbsolutePath(filepath);try{let s=JSON.stringify(obj,repl,ind);nodeDeps.fs.writeFileSync(filepath,s);return true}catch(e){if(doThrow){throw e}err=e}if(err){if(haveFn){error(err.message);return false}if(noThrow){return err.message}}return false};function makeAbsolutePath(filepath){if(!nodeDeps.path.isAbsolute(filepath)){filepath=nodeDeps.path.resolve(process.cwd(),filepath)}return filepath};function setNodeDeps(nd,utils){nodeDeps=nd;Utils=utils};module.exports.fileExistsSync=fileExists;module.exports.fileExists=fileExists;module.exports.pathExistsSync=pathExistsSync;module.exports.getFileTypeSync=getFileType;module.exports.getFileType=getFileType;module.exports.getFileTypeWithMsgSync=getFileTypeWithMsg;module.exports.getFileTypeWithMsg=getFileTypeWithMsg;module.exports.getFileExtSync=getFileExt;module.exports.getFileExt=getFileExt;module.exports.isSymLinkSync=isSymLink;module.exports.isSymLink=isSymLink;module.exports.createFolderSync=createFolder;module.exports.createFolder=createFolder;module.exports.deleteFolderSync=deleteFolder;module.exports.deleteFolder=deleteFolder;module.exports.readDirSync=readDir;module.exports.readDir=readDir;module.exports.readFileSync=readFileSync;module.exports.readFileBufSync=readFileBufSync;module.exports.readJsonSync=readJsonSync;module.exports.writeJsonSync=writeJsonSync;module.exports.makeAbsolutePath=makeAbsolutePath;module.exports.findFileSync=findFile;module.exports.findFile=findFile;module.exports.getUniqueFileNameSync=getUniqueFileName;module.exports.getUniqueFileName=getUniqueFileName;module.exports.setNodeDeps=setNodeDeps;
|
package/lib/Histo.js
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2018, 2022, Oracle and/or its affiliates.
|
|
3
|
+
* Licensed under The Universal Permissive License (UPL), Version 1.0
|
|
4
|
+
* as shown at https://oss.oracle.com/licenses/upl/
|
|
5
|
+
*/
|
|
6
|
+
const FULL_BLOCK="\u2588";const HALF_ELEM="\u2588";const FOURTH_ELEM="\u258C";function Histo(oStats,width,oColors){this._maxWidth=width;this._Colors=oColors;this._colorMode=oColors.isColor();this._count=0;let sev,nums=[];for(sev in oStats){nums.push(oStats[sev])};this._total=_sum(nums);this._maxBar=this._barLengths(nums);this._factor=this._maxBar>1?this._maxWidth/this._maxBar:1;this._clrCounts=_barColors(nums.length)};Histo.prototype.bar=function(n){var ret,val=n/this._total*this._maxWidth;var colors=this._Colors;if(val>0.5&&val<1){ret=HALF_ELEM.repeat(this._factor)}else if(val===0){ret=""}else if(val<0.5){ret=FOURTH_ELEM.repeat(this._factor)}else{ret=FULL_BLOCK.repeat(val*this._factor)}if(this._colorMode){ret=++this._count<=this._clrCounts[0]?colors.RED(ret):this._count<=this._clrCounts[1]?colors.BRIGHTBLUE(ret):colors.GREEN(ret)}return ret};Histo.prototype._barLengths=function(nums){var i,max=0,n;for(i=0;i<nums.length;i++){n=nums[i]/this._total*this._maxWidth;if(n>max){max=n}}this._factor=max>1?this._maxWidth/max:1;return max};function _sum(nums){var t=0;nums.forEach(n=>{if(!isNaN(n)){t+=n}});return t};function _barColors(n){var a=[];if(n===5){a.push(2);a.push(4)}else if(n===4){a.push(2);a.push(3);a.push(4)}else if(n===3){a.push(1);a.push(2);a.push(3)}else if(n<=2){a.push(1);a.push(2)}else if(n===1){a.push(1)}return a}module.exports=Histo;
|
package/lib/HtmlTree.js
CHANGED
|
@@ -1 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2018, 2022, Oracle and/or its affiliates.
|
|
3
|
+
* Licensed under The Universal Permissive License (UPL), Version 1.0
|
|
4
|
+
* as shown at https://oss.oracle.com/licenses/upl/
|
|
5
|
+
*/
|
|
6
|
+
const NodeType=require("./NodeTypes");const BAD_TAGS=["=","'","\"",",",".","/","\\",";",":","&","%","$","#","@","*"];var HtmlTree=function(nodeDeps,appContext,HtmlParser,domUtils){this._HtmlParser=HtmlParser;this._Dom=null;this._elemStack=[];this._DomUtils=domUtils;this._tabs=null;this._nodeDeps=nodeDeps;this._appContext=appContext;this._error=appContext.error;this._assert=appContext.assert;this._utils=this._appContext.utils};HtmlTree.prototype.walk=function(cb){var dom=this._Dom;var i;if(dom){for(i=0;i<dom.length;i++){this._walk2(dom[i],cb)}}cb.onEnd()};HtmlTree.prototype._walk2=function(node,cb){var tagName,attr,nt,nodePushed,inJsScript,i;nt=node.type;if(this.isScriptTypescript(node)){return}if(nt===NodeType.TAG||nt===NodeType.STYLE||nt===NodeType.SCRIPT){if(BAD_TAGS.includes(node.name.charAt(0))){return}this._elemStack.push(node);nodePushed=true;tagName=node.name;cb.onOpenTagname(node,tagName);inJsScript=this.isScriptExecutable(node);if(node.attribs){for(attr in node.attribs){cb.onAttribute(node,attr,node.attribs[attr])}}}else if(nt===NodeType.TEXT){cb.onText(node,node.data)}else if(nt===NodeType.COMMENT){cb.onComment(node,node.data)}else if(nt===NodeType.DIRECTIVE){if(node.data.charAt(0)==="?"){cb.onProcessingInstruction(node,node.data)}else{cb.onDirective(node,node.data)}}if(!inJsScript&&tagName!=="pre"&&nt!==NodeType.TEXT){if(node.children){for(i=0;i<node.children.length;i++){this._walk2(node.children[i],cb)}}}if(nodePushed){this._elemStack.pop()}};HtmlTree.prototype.getElemStack=function(){return this._elemStack};HtmlTree.prototype.dumpElemStack=function(){var i,s="",indent=" ";for(i=0;i<this._elemStack.length;i++){s+=i>0?"\n"+indent.repeat(i):"";s+=this._elemStack[i].name}return s};HtmlTree.prototype.getFirstTagNode=function(){var dom=this._Dom;var i,node,ret=null;if(dom){for(i=0;i<dom.length;i++){node=this._getFirstTagNode2(dom[i]);if(node){return node}}}return ret};HtmlTree.prototype._getFirstTagNode2=function(node){var nt,i;nt=node.type;if(nt===NodeType.TAG||nt===NodeType.STYLE||nt===NodeType.SCRIPT){return node}if(node.children){for(i=0;i<node.children.length;i++){node=this._getFirstTagNode2(node.children[i]);if(node){return node}}}return null};HtmlTree.prototype.getTopNode=function(){return this._Dom&&this._Dom.length>0?this._Dom[0]:null};HtmlTree.prototype.parse=function(pageText){var _self=this;this._Dom=null;this._data=pageText;var DomHandler=new this._HtmlParser.DomHandler(function(error,dom){if(error){_self._error("Parse Html tree error : "+error);return}else{_self._Dom=dom;_self._DomUtils.setDom(dom)}},{xmlMode:true,withStartIndices:true,withEndIndices:true,recognizeSelfClosing:true});var treeParser=new this._HtmlParser.Parser(DomHandler,{xmlMode:true,withStartIndices:true,withEndIndices:true,lowerCaseTags:false,lowerCaseAttributeNames:false,recognizeSelfClosing:true});treeParser.write(pageText);treeParser.end();this._applyParserFix1();this._applyParserFix2()};HtmlTree.prototype._applyParserFix1=function(){if(!this._Dom||this._Dom.length<2){return}if(this._Dom[0].type===NodeType.TEXT&&this._Dom[1].type===NodeType.DIRECTIVE){this._Dom[1].startIndex=this._Dom[0].endIndex}};HtmlTree.prototype._applyParserFix2=function(){var node;if(!this._Dom||this._Dom.length<1){return}node=this._Dom[0];if(node.type===NodeType.DIRECTIVE&&node.endIndex===null){node.endIndex=node.data.length}};HtmlTree.prototype.isScriptExecutable=function(scriptNode){var attribs=scriptNode.attribs;return scriptNode.type&&scriptNode.type===NodeType.SCRIPT&&(!attribs||!attribs.type||attribs.type.indexOf("html")<0&&attribs.type.indexOf("typescript")<0)};HtmlTree.prototype.isScriptJSLink=function(scriptNode){var ret=null;var attribs=scriptNode.attribs;if(attribs.src){ret=attribs.src.toLowerCase().endsWith("js")?attribs.src:null}return ret};HtmlTree.prototype.isScriptTypescript=function(scriptNode){var attribs=scriptNode.attribs;return scriptNode.type&&scriptNode.type===NodeType.SCRIPT&&attribs&&attribs.type&&attribs.type.indexOf("typescript")>=0};module.exports=HtmlTree;
|
package/lib/HtmlUtils.js
CHANGED
|
@@ -1 +1,6 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2018, 2022, Oracle and/or its affiliates.
|
|
3
|
+
* Licensed under The Universal Permissive License (UPL), Version 1.0
|
|
4
|
+
* as shown at https://oss.oracle.com/licenses/upl/
|
|
5
|
+
*/
|
|
1
6
|
const COMMON_ATTRS={"accesskey":true,"class":true,"contenteditable":true,"contextmenu":true,"dir":true,"draggable":true,"hidden":true,"id":true,"lang":true,"role":true,"spellcheck":true,"style":true,"tabindex":true,"title":true,"translate":true};var COMMON_ELEMS={"a":true,"abbr":true,"address":true,"area":true,"article":true,"aside":true,"audio":true,"b":true,"base":true,"bdi":true,"bdo":true,"blockquote":true,"body":true,"br":true,"button":true,"canvas":true,"caption":true,"cite":true,"code":true,"col":true,"colgroup":true,"command":true,"datalist":true,"dd":true,"del":true,"details":true,"dfn":true,"div":true,"dl":true,"dt":true,"em":true,"embed":true,"fieldset":true,"figcaption":true,"figure":true,"footer":true,"form":true,"h1":true,"h2":true,"h3":true,"h4":true,"h5":true,"h6":true,"head":true,"header":true,"hgroup":true,"hr":true,"html":true,"i":true,"iframe":true,"img":true,"input":true,"ins":true,"kbd":true,"keygen":true,"label":true,"legend":true,"li":true,"link":true,"map":true,"main":true,"mark":true,"menu":true,"meta":true,"meter":true,"nav":true,"noscript":true,"object":true,"ol":true,"optgroup":true,"option":true,"output":true,"p":true,"param":true,"pre":true,"progress":true,"q":true,"rp":true,"rt":true,"ruby":true,"s":true,"samp":true,"script":true,"section":true,"select":true,"small":true,"source":true,"span":true,"strong":true,"style":true,"sub":true,"summary":true,"sup":true,"table":true,"tbody":true,"td":true,"textarea":true,"tfoot":true,"th":true,"thead":true,"time":true,"title":true,"tr":true,"track":true,"u":true,"ul":true,"var":true,"video":true,"wbr":true,"svg":true};var COMMON_EVENT_ATTRS={"onabort":true,"onblur":true,"oncanplay":true,"oncanplaythrough":true,"onchange":true,"onclick":true,"oncontextmenu":true,"ondblclick":true,"ondrag":true,"ondragend":true,"ondragenter":true,"ondragleave":true,"ondragover":true,"ondragstart":true,"ondrop":true,"ondurationchange":true,"onemptied":true,"onended":true,"onerror":true,"onfocus":true,"onformchange":true,"onforminput":true,"oninput":true,"oninvalid":true,"onkeydown":true,"onkeypress":true,"onkeyup":true,"onload":true,"onloadeddata":true,"onloadedmetadata":true,"onloadstart":true,"onmousedown":true,"onmousemove":true,"onmouseout":true,"onmouseover":true,"onmouseup":true,"onmousewheel":true,"onpause":true,"onplay":true,"onplaying":true,"onprogress":true,"onratechange":true,"onreadystatechange":true,"onscroll":true,"onseeked":true,"onseeking":true,"onselect":true,"onshow":true,"onstalled":true,"onsubmit":true,"onsuspend":true,"ontimeupdate":true,"onvolumechange":true,"onwaiting":true};const SVG_ELEMS={"animate":true,"animatemotion":true,"animatetransform":true,"circle":true,"clippath":true,"color-profile":true,"defs":true,"desc":true,"discard":true,"ellipse":true,"feblend":true,"fecolormatrix":true,"fecomponenttransfer":true,"fecomposite":true,"feconvolvematrix":true,"fediffuselighting":true,"fedisplacementmap":true,"fedistantlight":true,"fedropshadow":true,"feflood":true,"fefunca":true,"fefuncb":true,"fefuncg":true,"fefuncr":true,"fegaussianblur":true,"feimage":true,"femerge":true,"femergenode":true,"femorphology":true,"feoffset":true,"fepointlight":true,"fespecularlighting":true,"fespotLight":true,"fetile":true,"feturbulence":true,"filter":true,"foreignobject":true,"g":true,"hatch":true,"hatchpath":true,"image":true,"line":true,"lineargradient":true,"marker":true,"mask":true,"mesh":true,"meshgradient":true,"meshpatch":true,"meshrow":true,"metadata":true,"mpath":true,"path":true,"pattern":true,"polygon":true,"polyline":true,"radialgradient":true,"rect":true,"script":true,"set":true,"solidcolor":true,"stop":true,"style":true,"svg":true,"switch":true,"symbol":true,"text":true,"textpath":true,"title":true,"tspan":true,"unknown":true,"use":true,"view":true};const HTML5_OBS_TAGS={"applet":true,"acronym":true,"basefont":true,"bgsound":true,"big":true,"blink":true,"center":true,"dir":true,"font":true,"frame":true,"frameset":true,"noframes":true,"isindex":true,"keygen":true,"listing":true,"marquee":true,"menuitem":true,"multicol":true,"nextid":true,"nobr":true,"noembed":true,"plaintext":true,"rb":true,"rlc":true,"s":true,"spacer":true,"strike":true,"tt":true,"xmp":true};const HTML5_OBS_ATTRS={"a":["charset","coords","methods","name","rev","shape","urn"],"area":["nohref"],"body":["alink","background","bgcolor","bottommargin","leftmargin","link","marginheight","marginwidth","rightmargin","text","vlink"],"br":["clear"],"caption":["align"],"col":["align","char","charoff","valign","width"],"div":["align"],"dl":["compact"],"embed":["align","name","hspace","vspace"],"form":["accept"],"head":["profile"],"hr":["align","noshade","size","width"],"h1":["align"],"h2":["align"],"h3":["align"],"h4":["align"],"h5":["align"],"h6":["align"],"html":["version"],"iframe":["align","allowtransparency","frameborder","framespacing","hspace","longdesc","marginheight","marginwidth","scrolling","vspace"],"img":["align","border","hspace","longdesc","lowsrc","name","vspace"],"input":["align","border","hspace","ismap","usemap","vspace"],"legend":["align"],"li":["type"],"link":["charset","methods","rev","target","urn"],"menu":["compact","label","type"],"meta":["scheme"],"object":["align","archive","border","classid","code","codebase","codetype","declare","hspace","standby","typemustmatch","vspace"],"ol":["compact"],"option":["name"],"p":["align"],"param":["type","valuetype"],"pre":["width"],"script":["charset","event","for","language"],"style":["type"],"table":["align","background","bgcolor","border","bordercolor","cellpadding","cellspacing","datapagesize","frame","height","rules","summary","width"],"tbody":["align","background","char","charoff","valign"],"tfoot":["align","background","char","charoff","valign"],"thead":["align","background","char","charoff","valign"],"td":["abbr","align","axis","background","bgcolor","char","charoff","height","nowrap","scope","valign","width"],"th":["abbr","align","axis","background","bgcolor","char","charoff","height","nowrap","valign","width"],"tr":["align","background","bgcolor","char","charoff","height","valign"],"ul":["compact","type"]};const HTML5_OBS_ATTR_ALL_ELEM=["contextmenu","dropzone","onshow"];const SELF_CLOSING_ELEMS={"area":true,"base":true,"br":true,"embed":true,"hr":true,"iframe":true,"img":true,"input":true,"link":true,"meta":true,"param":true,"source":true,"track":true};const OJ_NAMESPACE_PREFIXES=require("./ns");module.exports.isCommonAttr=function(attrName){var x;attrName=attrName.toLowerCase();attrName=attrName.charAt(0)===":"?attrName.substr(1):attrName;x=attrName.indexOf(".");if(x>=0){attrName=attrName.substring(0,x)};return COMMON_ATTRS[attrName]||attrName.startsWith("aria-")||attrName.startsWith("data-")&&attrName!=="data-oj-command"&&attrName!=="data-oj-context"};module.exports.isCommonEventAttr=function(attrName){attrName=attrName.toLowerCase();attrName=attrName.charAt(0)===":"?attrName.substr(1):attrName;if(attrName.startsWith("on-oj-")){return false}if(attrName.startsWith("on-")){attrName=attrName.substring(0,2)+attrName.substring(3)}return COMMON_EVENT_ATTRS[attrName]};module.exports.isCommonElem=function(elem){return COMMON_ELEMS[elem.toLowerCase()]};module.exports.isSvgElem=function(elem){return SVG_ELEMS[elem.toLowerCase()]};module.exports.isSelfClosingTag=function(elem){return SELF_CLOSING_ELEMS[elem]};module.exports.isNamespacePrefix=function(prefix){return OJ_NAMESPACE_PREFIXES.has(prefix)};module.exports.isNamespaceTag=function(tag){var s=tag.replace(/[<>]/g,"");var x,ret=false;if(tag.startsWith("demo-")||tag.startsWith("my-")||tag.startsWith("ns-")){return true}while(true){x=s.lastIndexOf("-");if(x>=0){s=s.substring(0,x);if(s.lastIndexOf("-")<0&&s==="oj"){break}if(OJ_NAMESPACE_PREFIXES.has(s)){ret=true;break}}else{break}}return ret};module.exports.isHtml5ObsoleteElem=function(tag){return HTML5_OBS_TAGS[tag.toLowerCase()]};module.exports.isHtml5ObsoleteAttr=function(tagName,attrName){var depAttrs,ret=false;attrName=attrName.charAt(0)!==":"?attrName:attrName.substring(1);depAttrs=HTML5_OBS_ATTRS[tagName];if(!depAttrs){depAttrs=HTML5_OBS_ATTR_ALL_ELEM}if(depAttrs){if(depAttrs.includes(attrName)){ret=true}}return ret};const EXPR_CHARS=new RegExp("[?\"'=+:/()[]{}]","g");module.exports.isEncodedLiteral=function(expr){if(expr.charAt(0)==="'"&&expr.charAt(expr.length-1)==="'"){return EXPR_CHARS.test(expr.substring(1,expr.length-1))}return false};module.exports.replaceEntities=function(s){const ENTITY_LT=/</g;const ENTITY_GT=/&/g;const ENTITY_QUOT=/"/g;const ENTITY_APOS=/'/g;const ENTITY_AMP=/&/g;const ENTITY_NBSP=/ /g;if(s.indexOf("&")>=0){s=s.replace(ENTITY_LT,"<");s=s.replace(ENTITY_GT,"&");s=s.replace(ENTITY_QUOT,"\"");s=s.replace(ENTITY_APOS,"'");s=s.replace(ENTITY_AMP,"&");s=s.replace(ENTITY_NBSP," ")}return s};
|
package/lib/Issue.js
CHANGED
|
@@ -1 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2018, 2022, Oracle and/or its affiliates.
|
|
3
|
+
* Licensed under The Universal Permissive License (UPL), Version 1.0
|
|
4
|
+
* as shown at https://oss.oracle.com/licenses/upl/
|
|
5
|
+
*/
|
|
6
|
+
var Issue=function(msg,id){this.msg=msg;if(id){this.setId(id)}};Issue.prototype.setMsg=function(msg){this.msg=msg;return this};Issue.prototype.setId=function(id){this.msgId=id||"0000";return this};Issue.prototype.setMsgKey=function(key){this.msgKey=key;return this};Issue.prototype.setPosition=function(arg,col,startIndex,endIndex){var line;if(arg&&typeof arg==="object"){if(arg.hasOwnProperty("startIndex")){startIndex=arg.startIndex}else if(arg.hasOwnProperty("start")){startIndex=arg.start}if(arg.hasOwnProperty("endIndex")){endIndex=arg.endIndex}else if(arg.hasOwnProperty("end")){endIndex=arg.end}if(arg.hasOwnProperty("line")){line=arg.line}else if(arg.hasOwnProperty("row")){line=arg.row}col=arg.col}else{line=arg}if(line!==null&&col!==null){this.index={line:line,col:col}}if(startIndex!==undefined){if(!this.index){this.index={}}this.index.start=startIndex;this.index.end=endIndex}return this};Issue.prototype.setSeverity=function(severity){if(severity){this.severity=severity}return this};Issue.prototype.setReportedFilePath=function(fp){this.filepath=fp};module.exports=Issue;
|
package/lib/JafEvents.js
CHANGED
|
@@ -1 +1,6 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2018, 2022, Oracle and/or its affiliates.
|
|
3
|
+
* Licensed under The Universal Permissive License (UPL), Version 1.0
|
|
4
|
+
* as shown at https://oss.oracle.com/licenses/upl/
|
|
5
|
+
*/
|
|
1
6
|
const EVENT_ISSUE="on-jaf-issue";const EVENT_MESSAGE="on-jaf-message";const EVENT_SUMMARY="on-jaf-summary";const EVENTS=[EVENT_ISSUE,EVENT_MESSAGE,EVENT_SUMMARY];function JafEvents(){this._emitter=null;this._listeners=[];this.JAF_EVENT_ISSUE=EVENT_ISSUE;this.JAF_EVENT_MESSAGE=EVENT_MESSAGE;this.JAF_EVENT_SUMMARY=EVENT_SUMMARY};JafEvents.prototype.setListener=function(evName,fn,obj){if(EVENTS.includes(evName)){if(!this._emitter){var EventEmitter=require("events").EventEmitter;this._emitter=new EventEmitter}this._listeners.push({event:evName,fn:fn,obj:obj});this._emitter.on(evName,fn)}};JafEvents.prototype.emit=function(evName,obj){if(this._emitter)this._emitter.emit(evName,obj,this._getEventExtra(evName))};JafEvents.prototype.removeAllListeners=function(evName){if(this._emitter){if(evName){this._emitter.removeAllListeners(evName)}else{this._emitter.removeAllListeners(EVENT_ISSUE);this._emitter.removeAllListeners(EVENT_MESSAGE);this._emitter.removeAllListeners(EVENT_SUMMARY)}this._listeners.length=0}};JafEvents.prototype.removeListener=function(evName,fn){var listener,a,i;if(!this._emitter){return}a=this._emitter.listeners(evName);for(i=0;i<a.length;i++){if(a[i]===fn){this._emitter.removeListener(evName,fn)}}for(i=0;i<this._listeners.length;i++){listener=this._listeners[i];if(evName===listener.event&&fn===listener.fn){this._listeners.splice(i,1);i--}}};JafEvents.prototype._getEventExtra=function(evName){var listener,i,ret;for(i=0;i<this._listeners.length;i++){listener=this._listeners[i];if(evName===listener.event){ret=listener.obj;break}}return ret};module.exports=JafEvents;
|
package/lib/JafLib.js
CHANGED
|
@@ -1 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2018, 2022, Oracle and/or its affiliates.
|
|
3
|
+
* Licensed under The Universal Permissive License (UPL), Version 1.0
|
|
4
|
+
* as shown at https://oss.oracle.com/licenses/upl/
|
|
5
|
+
*/
|
|
6
|
+
const CLI_MODE="cli";const API_MODE="api";const AMD_MODE="amd";function JafLib(nd,jfs,mctx,runMode,jafver,jv,cfg){this._rdy=-1;this.setup(nd,jfs,mctx,runMode,jafver,jv,cfg)};JafLib.prototype.getFileset=function(ruleCtx){if(this._nd&&ruleCtx.phase&&ruleCtx.phase==="startaudit"){return this._jfs.getFiles()}};JafLib.prototype.setFileset=function(ruleCtx,files,exclude){var rc=false;if(this._nd&&ruleCtx.phase&&ruleCtx.phase==="startaudit"){if(files&&!Array.isArray(files)||exclude&&!Array.isArray(exclude)){this._mCtx.error("Rule '"+ruleCtx.ruleName+"' attempt to call JafLib.setfiles() with non-array");this._jfs.setFiles(null,null);return false}this._jfs.setFiles(files,exclude);rc=true}return rc};JafLib.prototype.getRunMode=function(){return this._runMode};JafLib.prototype.getConfig=function(){return this._cfg};JafLib.prototype.getTsConfigObj=function(){return this._cfg.getTsConfigObj()};JafLib.prototype.isCLI=function(){return this._runMode===CLI_MODE};JafLib.prototype.isAPI=function(){return this._runMode===API_MODE};JafLib.prototype.isAMD=function(){return this._runMode===AMD_MODE};JafLib.prototype.getJetVer=function(){return this._jetver};JafLib.prototype.getJafVer=function(){return this._jafver};JafLib.prototype.setup=function(nd,jfs,mctx,runMode,jafver,jv,cfg){if(this._rdy===-1){this._nd=nd;this._jfs=jfs;this._mCtx=mctx;this._runMode=runMode;this._jafver=jafver;this._jetver=jv;this._cfg=cfg}};JafLib.prototype.disable=function(){this._rdy=-2};JafLib.prototype.getJafLib=function(){return{getConfig:this.getConfig.bind(this),getTsConfigObj:this.getTsConfigObj.bind(this),getRunMode:this.getRunMode.bind(this),isCLI:this.isCLI.bind(this),isAPI:this.isAPI.bind(this),isAMD:this.isAMD.bind(this),getJetVer:this.getJetVer.bind(this),getJafVer:this.getJafVer.bind(this)}};JafLib.prototype.getPublic=function(){return{setFileset:this.setFileset.bind(this),getFileset:this.getFileset.bind(this)}};module.exports=JafLib;
|
package/lib/Json.js
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2018, 2022, Oracle and/or its affiliates.
|
|
3
|
+
* Licensed under The Universal Permissive License (UPL), Version 1.0
|
|
4
|
+
* as shown at https://oss.oracle.com/licenses/upl/
|
|
5
|
+
*/
|
|
6
|
+
const AstJson=require("../lib/AstJson");const FILETYPE=require("./filetypes");class Json{constructor(parser,nd,rules,fileIndex,appCtx,msgCtx){this._parser=parser;this._rules=rules;this._Issue=appCtx.Issue;this._reporter=appCtx.reporter;this._fileIndex=fileIndex;this._utils=appCtx.utils;this._msgCtx=msgCtx;this._nd=nd;this._Ast=null;this._AstJson=new AstJson(msgCtx)}parse(data,file){var suppData,rc;suppData=this._checkSyntax(data,false);rc=this._parser.fireHookFileRules(suppData.ast,suppData,false);if(typeof rc==="undefined"||typeof rc==="boolean"&&rc){this._rules.fireRules({type:FILETYPE.JSON,obj:suppData,tagNode:null,rawData:this._rawData,data:this._data,suppData:suppData},null,file,FILETYPE.JSON,suppData,false)}this._parser.fireHookFileRules(null,null)}parseOnly(data){return this._checkSyntax(data,false)}getAst(){return this._Ast}clear(){}_checkSyntax(data,hasComments){var suppData=this._isValidJson(data,hasComments);if(typeof suppData.msg==="string"){suppData.ast=null;this._parser.startIndex=this._parser.endIndex=suppData.position}else{suppData.ast=this._AstJson.parse(data);this._startIndex=this._endIndex=0}return suppData}_isValidJson(data,isComments){var obj=this._utils.parseJson(data,isComments);if(obj.msg){obj.msg=obj.msg+` at line ${obj.line}, col ${obj.col} (position ${obj.startIndex})`;obj.position=obj.startIndex}return obj}}module.exports=Json;
|
package/lib/JsonLoader.js
CHANGED
|
@@ -1 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2018, 2022, Oracle and/or its affiliates.
|
|
3
|
+
* Licensed under The Universal Permissive License (UPL), Version 1.0
|
|
4
|
+
* as shown at https://oss.oracle.com/licenses/upl/
|
|
5
|
+
*/
|
|
6
|
+
function load(inFile,nd,fnError,allowComments,utils){var obj=null,json;try{if(nd.fs.existsSync(inFile)){json=nd.fs.readFileSync(inFile,'utf8');if(allowComments){json=nd.decomment(json)}obj=JSON.parse(nd.decomment(json))}else{if(fnError){fnError(`file not found "${inFile}"`)}}}catch(e){if(fnError){let msg=_convertJsonPosToRowCol(e.message,nd.fs.readFileSync(inFile,'utf8'),utils);fnError(msg?msg:e.message)}}return obj};function _convertJsonPosToRowCol(msg,data,utils){var x,n,rc;x=msg.indexOf('position');if(x<0){return null}n=parseInt(msg.substr(x+8).trim());rc=utils.getRowColFromIndex(data,n);return msg.substr(0,x)+'row '+rc.row+', col '+rc.col};module.exports.load=load;
|
package/lib/Md.js
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2018, 2022, Oracle and/or its affiliates.
|
|
3
|
+
* Licensed under The Universal Permissive License (UPL), Version 1.0
|
|
4
|
+
* as shown at https://oss.oracle.com/licenses/upl/
|
|
5
|
+
*/
|
|
6
|
+
const AstMd=require("../lib/AstMd");const FILETYPE=require("./filetypes");class Md{constructor(parser,nd,rules,fileIndex,appCtx,msgCtx){this._parser=parser;this._rules=rules;this._Issue=appCtx.Issue;this._reporter=appCtx.reporter;this._utils=appCtx.utils;this._msgCtx=msgCtx;this._nd=nd;this._Ast=null;this._AstMd=new AstMd(appCtx)}parse(data,file){var suppData,rc;this._Ast=this._AstMd.parse(data,{});suppData={ast:this._Ast,utils:this._AstMd.createHandler()};rc=this._parser.fireHookFileRules(suppData.ast,suppData,false);if(typeof rc==="undefined"||typeof rc==="boolean"&&rc){this._fireMdEvents(suppData,file)}this._parser.fireHookFileRules(null,null)}getAst(){return this._Ast}clear(){this._Ast=null}_fireMdEvents(suppData,file){var data,prop,obj,val,utils=suppData.utils;data=utils.getLinks();data.forEach(link=>{this._fireEvent("md-link",link,suppData,file)});data=utils.getRefLinks();obj={};for(prop in data){val=data[prop];obj.refKey=prop;obj.link=val.link;obj.pos=val.pos;this._fireEvent("md-ref",obj,suppData,file)}data=utils.getParas();data.forEach(para=>{this._fireEvent("md-para",para,suppData,file)});data=utils.getImages();data.forEach(img=>{this._fireEvent("md-image",img,suppData,file)});data=utils.getLists();data.forEach(list=>{this._fireEvent("md-list",list,suppData,file)});data=utils.getCode();data.forEach(code=>{this._fireEvent("md-code",code,suppData,file)})}_fireEvent(type,arg1,suppData,file){this._rules.fireRules({type:type,obj:suppData,tagNode:null,rawData:this._rawData,data:this._data,suppData:suppData},arg1,file,FILETYPE.MD,suppData,false)}}module.exports=Md;
|
package/lib/MetaLib.js
CHANGED
|
@@ -1 +1,6 @@
|
|
|
1
|
-
"use strict";const Namespaces=require("./ns");const HtmlUtils=require("./HtmlUtils");const SemVer=require("semver");var nodeDeps;const NO_SUGGESTION_AVAIL="No suggestion available.";const OJPREFIX="oj-";const OJEVENTPREFIX="on-oj-";const OJS="ojs/oj";const EVENT_PREFIX="on-";const DOT=".";const DATA_OJ_CMD="data-oj-command";function MetaLib(nd,runMode,msgContext,utils){this._json=null;this._delHist=null;this._renHist=null;this._reqAttrs=null;this._nonClasses=null;this._components=null;this._compSvcs=null;this._stylesets=null;this._runMode=runMode;this._utils=utils;this._domUtils=null;if(nd.jetver){this._jetVersions=nd.jetver.getVersions();this._jetDefVersion=nd.jetver.getDefault()}this._jetVer=null;this._theme=null;this._deprecatedMethods=null;this._deprecatedMembers=null;this._deletedMethods=null;this._deletedMembers=null;this._error=msgContext.error;this._debug=msgContext.debug;this._info=msgContext.info;this._msg=msgContext.msg;nodeDeps=nd};MetaLib.prototype.isNSRegistered=function(prefix){return Namespaces.has(prefix)};MetaLib.prototype.isNamespacePrefix=function(tagName){return HtmlUtils.isNamespaceTag(tagName)};MetaLib.prototype.isJetTag=function(tagName){return!!this._getComponentNameFromTag(_removeChevrons(tagName))};MetaLib.prototype.isComponentTag=function(tagName){return this._components&&this._components.isTag(_removeChevrons(tagName))};MetaLib.prototype.isWCTag=function(tagName){return this.isJetTag(tagName)||this.isComponentTag(tagName)};MetaLib.prototype.isCCATag=function(tagName){return this.isWCTag(tagName)};MetaLib.prototype.isTagDeprecated=function(tagName){var clazz=this._getComponentNameFromTag(_removeChevrons(tagName));return this.isClassDeprecated(clazz)};MetaLib.prototype.isTagAttrDeprecated=function(tagName,attrName){var member,ret=null;member=this._getTagAttrMemberObj(tagName,attrName);if(member){ret=this._isSubStateDeprecated(member)}else{ret=this._components.isTagAttrDeprecated(tagName,attrName)}if(ret){if(typeof ret==="string"){ret=HtmlUtils.replaceEntities(ret)}else{ret.description=HtmlUtils.replaceEntities(ret.description)}}return ret};MetaLib.prototype.isTagAttr=function(tagName,attrName){var o,ret=false;attrName=attrName.charAt(0)===":"?attrName.substr(1):attrName;if(this.isCCATag(tagName)){o=this._getComponentFromTag(tagName);if(o){ret=this.isJetTagAttr(o,attrName)}else{ret=this._components&&this._components.isTagAttr(tagName,attrName)}}return ret};MetaLib.prototype.isJetTagAttr=function(tagObj,attrName){attrName=attrName.charAt(0)===":"?attrName.substr(1):attrName;var ret=!!(tagObj.htmlattributes&&tagObj.htmlattributes[attrName]);if(!ret&&attrName===DATA_OJ_CMD){ret=!!tagObj.member[DATA_OJ_CMD]}return ret};MetaLib.prototype._getTagAttrMemberObj=function(tagName,attrName){var obj,attrib,member,x;obj=this._getComponentFromTag(_removeChevrons(tagName));attrName=attrName.charAt(0)===":"?attrName.substr(1):attrName;if(!obj||!obj.htmlattributes||!obj.htmlattributes[attrName]){return null}member=null;attrib=obj.htmlattributes[attrName];if(attrib){x=attrib.indexOf(DOT);if(x>=0){if(obj.member){member=this._findSubMember(obj,obj.member,attrib,attrib)}}else{member=obj.member[attrib];if(member){return member}}}return member};MetaLib.prototype._findSubMember=function(obj,mem,attrName,subMemberPart){var member,ts,sm,rest,x,ret=null;x=subMemberPart.indexOf(DOT);if(x>=0){sm=subMemberPart.substring(0,x);rest=subMemberPart.substring(x+1)}else{sm=subMemberPart;rest=null}for(member in mem){member=mem[member];if(member.name!==sm){continue}if(!rest){ret=member;break}if(member.submember){ret=this._findSubMember(obj,member.submember,attrName,rest);if(ret){break}}else if(member.tstype){ts=this._getTsTypeObject(member);if(ts){ret=this._findSubMember(obj,ts.member,attrName,rest);if(ret){break}}}if(ret){break}}return ret};MetaLib.prototype._getTsTypeObject=function(mem){var ts,o,s,x;ts=mem.tstype;if(ts&&ts.target==="Type"&&typeof ts.value==="string"){s=ts.value;s=s.replace("=","");x=s.indexOf("|");if(x>=0){s=s.substring(0,x).trimRight()}if(s.charAt(s.length-1)===">"){x=s.lastIndexOf("<");if(s>=0){s=s.substring(0,x)}}o=this._json[s];if(!o){o=this._json[mem.memberof];if(o.typedef){s=ts.value;x=s.lastIndexOf(DOT);if(x>=0){s=s.substring(x+1);o=o.typedef[s]}}}}return o?o:null};MetaLib.prototype._getSubMemberPart=function(fullAttr,soFar){var s,x;s=fullAttr.replace(soFar,"");if(s.length){if(s.charAt(0)==="."){x=s.indexOf(DOT,1);if(x>=0){s=soFar+s.substring(0,x)}else{s=soFar+s}}}else{s=soFar}return s};MetaLib.prototype._handleAttrObject=function(member){var link,types,i,x;types=member.tstype;if(types){for(i=0;i<types.length;i++){if(types[i].target==="Type"){link=types[i].value;link=link.replace("=","");x=link.indexOf("<K");if(x>=0){link=link.substring(0,x)}break}}}return link};MetaLib.prototype.hasTagAttrValues=function(tagName,attrName){var member,ojv,ret=false;member=this._getTagAttrMemberObj(tagName,attrName);if(member){ojv=this._getOjValues(member);return!!ojv}else if(this._components.isTag(tagName)){ret=this._components.hasTagAttrValues(tagName,attrName)}return ret};MetaLib.prototype.isTagAttrValue=function(tagName,attrName,attrValue){var member,ojv,values,curValue,valType,i,ret=false;member=this._getTagAttrMemberObj(tagName,attrName);if(member){ojv=this._getOjValues(member);if(ojv){values=ojv.name;for(i=0;i<values.length;i++){if(ojv.type){valType=ojv.type[i];curValue=_convertValue(valType,attrValue);ret=curValue===values[i]}else{ret=attrValue===values[i]}if(ret){break}}}else{ret=true}}else{if(this._components.isTag(tagName)){ret=this._components.isTagAttrValue(tagName,attrName,attrValue)}}return ret};MetaLib.prototype.isTagAttrEnumValueDeprecated=function(tagName,attrName,enumValue){var member,ojv,values,deps,dep,i,j,ret=null;member=this._getTagAttrMemberObj(tagName,attrName);if(!member){return this._isCompTagAttrEnumDepr(tagName,attrName,enumValue)}if(member.ojdeprecated){ojv=this._getOjValues(member);if(ojv){values=ojv.name;for(i=0;i<values.length;i++){if(values[i]===enumValue){deps=member.ojdeprecated;for(j=0;j<deps.length;j++){dep=deps[j];if(dep.target==="propertyValue"&&dep.for===enumValue){ret={since:dep.since,description:dep.description};break}}}if(ret){break}}}}return ret};MetaLib.prototype._isCompTagAttrEnumDepr=function(tagName,attrName,enumValue){return this._components.isTagAttrEnumDeprecated(tagName,attrName,enumValue)};MetaLib.prototype.hasTagSlot=function(tagName){return this._getSlots(tagName)?true:false};MetaLib.prototype.hasDynamicTagSlot=function(tagName){};MetaLib.prototype.isTagSlotValue=function(tagName,slotName){var tag,slot;tag=_removeChevrons(tagName);if(this.isJetTag(tagName)){slot=this._getSlotByName(this._getComponentFromTag(tag),slotName)}else{if(!HtmlUtils.isCommonElem(tag)&&this._components){slot=this._components.hasTagSlotName(tag,slotName)}}return!!slot};MetaLib.prototype.isTagDynamicSlotValue=function(tagName,slotName){};MetaLib.prototype.isTagSupportedInTheme=function(tag){var o,a,ret=true;o=this._getComponentFromTag(tag);if(o){if(o.header){a=o.header.ojunsupportedthemes;ret=!(a&&a.includes(this._theme))}}else{ret=this._components&&this._components.isTagSupportedInTheme(tag,this._theme)}return ret};MetaLib.prototype.isAttrSupportedInTheme=function(tag,attr){var o,a,ret=true;o=this._getTagAttrMemberObj(tag,attr);if(o){a=o.ojunsupportedthemes;ret=!(a&&a.includes(this._theme))}else{ret=this._components.isAttrSupportedInTheme(tag,attr,this._theme)}return ret};MetaLib.prototype.hasTagCompPropSubprop=function(tagName,propName){var obj,ret=false;if(this.isCCATag(tagName)){obj=this._getComponentFromTag(tagName);if(obj&&obj.member){ret=obj.member[propName];ret=ret&&ret.submember}else if(this._components){ret=this._components.getTagProp(tagName,propName);ret=ret&&ret.properties}}return ret};MetaLib.prototype.isTagCompProp=function(tagName,propName){var obj,ret=false;if(this.isCCATag(tagName)){obj=this._getComponentFromTag(tagName);if(obj&&obj.member){ret=obj.member[propName]}else if(this._components){ret=this._components.isTagProp(tagName,propName)}}return ret};MetaLib.prototype.getTagPropType=function(tagName,propName){var ret;if(this._components){ret=this._components.getTagPropType(tagName,propName)}return ret};MetaLib.prototype.isTagStyleDeprecated=function(tagName,styleName){var o,ret;o=this.isWCStyleDeprecated(styleName);if(o){tagName=_removeChevrons(tagName);if(this._json.ojStyles.containers[o.index]===tagName){ret=o.dep.description}}return ret};MetaLib.prototype.isTagStyle=function(tagName,styleName){var obj,ret=false,compName,containers,indices,index,i;tagName=_removeChevrons(tagName);obj=this._getComponentFromTag(tagName);if(obj){compName=this._getComponentNameFromTag(tagName);containers=this._json.ojStyles.containers;indices=_getStyleIndices(this._json.ojStyles,styleName);if(indices){for(i=0;i<indices.length;i++){index=indices[i];if(index>=0){if(containers[index]===compName){ret=true;break}}}}}return!!ret};MetaLib.prototype.isStyle=function(style){return this.isGenStyle(style)||this.isClassStyle(style)||this.isStylesetStyle(style)};MetaLib.prototype.isGenStyle=function(style){var x=this._json.genericStyles[style];return x||x===0?true:false};MetaLib.prototype.isJetStyle=function(style){return this._json.genericStyles[style]?"g":this._json.ojStyles[style]?"j":undefined};MetaLib.prototype.isNonCoreStyle=function(style){return this._json.genericStyles[style]?"g":this._json.ojStyles[style]?"j":undefined};MetaLib.prototype.getStyleOrigin=function(style){var ret;if(this._json.genericStyles[style]){ret="g"}if(this._json.ojStyles[style]){ret=ret?"b":"j"}return ret};MetaLib.prototype.isClassStyle=function(style){var x=this._json.ojStyles[style];return x||x===0?true:false};MetaLib.prototype.isStylesetStyle=function(style){return this._stylesets?!!this._stylesets[style]:false};MetaLib.prototype.getStyleSelector=function(style,jet){var o,i,ret;if(typeof jet==="boolean"){o=jet?this._json.ojStyles[style]:this._json.genericStyles[style]}else{o=this._json.ojStyles[style];if(!o&&o!==0){o=this._json.genericStyles[style]}}if(this._utils.isObject(o)&&o.styleselector){ret=o.styleselector}else if(Array.isArray(o)){for(i=0;i<o.length;i++){if(this._utils.isObject(o[i])&&o[i].styleselector){if(!ret){ret=[]}ret.push(o[i].styleselector)}}if(ret&&ret.length===1){ret=ret[0]}}return ret?ret:null};MetaLib.prototype.isJetStylePrefix=function(s){var x;if(!s.startsWith(OJPREFIX)||!this._json.jetCssPrefixes.classes){return false}x=s.indexOf("-",3);if(x>=0){s=s.substring(0,x)}return this._json.jetCssPrefixes.classes.includes(s)};MetaLib.prototype.hasJetStylePrefixes=function(){return this._json.jetCssPrefixes&&this._json.jetCssPrefixes.classes};MetaLib.prototype.getClassesFromStyle=function(styleName,scope){var indices,oStyles,ret;scope=scope||"oj";if(scope==="oj"||scope==="both"){oStyles=this._json.ojStyles;if(oStyles){indices=_getStyleIndices(oStyles,styleName);if(indices){return _toContainers(oStyles,indices)}}}if(scope==="gen"||scope==="both"){oStyles=this._json.genericStyles;if(oStyles){indices=_getStyleIndices(oStyles,styleName);if(indices){ret=_toContainers(oStyles,indices)}}}return ret?ret:null};MetaLib.prototype.getJetTagFromStyle=function(styleName){var indices,oStyles,clazz;oStyles=this._json.ojStyles;if(oStyles){indices=_getStyleIndices(oStyles,styleName)}if(indices){if(indices.length>1||indices.length===0){clazz=null}else{clazz=this.isGenStyle(styleName)?null:_toContainers(oStyles,indices)}}return clazz?this.getTagFromClass(clazz):null};MetaLib.prototype.getJetTagsFromStyle=function(styleName){var indices,oStyles;oStyles=this._json.ojStyles;if(oStyles){indices=_getStyleIndices(oStyles,styleName);if(indices){return _toContainers(oStyles,indices,this._json)}}return null};MetaLib.prototype.getClassFromTag=function(tagName){return this._getComponentNameFromTag(_removeChevrons(tagName))};MetaLib.prototype.getClassFromModule=function(module){var clazz=this._json.moduleLookup[module];return clazz?clazz:null};MetaLib.prototype.getTagFromClass=function(className){if(className==="oj.ojTree"){return"oj-tree"}var ret=this._json[className];return ret&&ret.header?ret.header.customelement:null};MetaLib.prototype.isClass=function(className){return this._json[className]};MetaLib.prototype.isClassFinal=function(className){var clazz=this._json[className];return clazz&&clazz.header&&clazz.header.readonly};MetaLib.prototype.isClassMethod=function(className,methName){var clazz=this._json[className];return!!(clazz&&clazz.function&&clazz.function[methName])};MetaLib.prototype.isClassMethodStatic=function(className,methName){var meth,ret=null;var clazz=this._json[className];if(clazz&&clazz.function){meth=clazz.function[methName];ret=meth&&meth.scope&&meth.scope=="static"}return ret};MetaLib.prototype.getClassMethodScope=function(className,methName){var meth,ret=null;var clazz=this._json[className];if(clazz&&clazz.function){meth=clazz.function[methName];ret=meth.scope}return ret};MetaLib.prototype.isClassMember=function(className,memName){var clazz=this._json[className];return!!(clazz&&clazz.member&&clazz.member[memName])};MetaLib.prototype.isClassMemberStatic=function(className,memName){var mem,ret=null;var clazz=this._json[className];if(clazz&&clazz.member){mem=clazz.member[memName];ret=mem&&mem.scope&&mem.scope=="static"}return ret};MetaLib.prototype.getRequiredAttrs=function(tagName){let obj,clazz,i,ret=null;tagName=_removeChevrons(tagName);obj=this._getComponentFromTag(tagName);if(obj){clazz=this._getComponentNameFromTag(tagName)}ret=obj?this._reqAttrs[clazz]:this._components.getRequiredAttrs(tagName);if(obj&&ret&&ret.length){for(i=0;i<ret.length;i++){ret[i]=this._domUtils.kebabCase(ret[i])}}return ret};MetaLib.prototype.getTagsFromStyle=function(styleName){var classNames,tag,i,ret;ret=null;classNames=this.getClassesFromStyle(styleName);if(classNames){for(i=0;i<classNames.length;i++){tag=this.getTagFromClass(classNames[i]);if(tag){if(!ret){ret=[]}ret.push(tag)}}}return ret?ret:null};MetaLib.prototype.isStyleDeprecated=function(name){var s,o,t,i;s=this._json.genericStyles[name];if(!s&&s!==0&&this._json.ojStyles){s=this._json.ojStyles[name];if(!s&&s!==0&&this._stylesets){s=this._stylesets[name];return this._utils.isObject(s)?s:null}}if(s){t=typeof s;if(Array.isArray(s)){for(i=0;i<s.length;i++){o=s[0];if(typeof o==="object"){break}}}else if(t==="object"){o=s}else{o=null}}return o?o.dep:null};MetaLib.prototype.isWCStyleDeprecated=function(name){var s,o,t,i;s=this._json.ojStyles[name];if(s){t=typeof s;if(Array.isArray(s)){for(i=0;i<s.length;i++){o=s[i];if(typeof o==="object"){break}o=null}}else if(t==="object"){o=s}}return o?o:null};MetaLib.prototype.isBindingTag=function(tagName){var obj=this._getComponentFromTag(_removeChevrons(tagName));return obj&&obj.header?!!obj.header.ojbindingelement:false};MetaLib.prototype.isComponent=function(className){var obj=this._json[className];if(!obj){if(!className.startsWith("oj.")){obj=this._json["oj."+className]}}return!!obj};MetaLib.prototype.isClass=function(className){return!!this._json[className]};MetaLib.prototype.isJetComponentClass=function(className){return this.isClass(className)};MetaLib.prototype.isComponentDeprecated=function(className){return this.isClassDeprecated(className)};MetaLib.prototype.isClassDeleted=function(className){var classes,cn,version=null;if(this._delHist){classes=this._delHist.classes;if(classes){cn=this._classChange[className];if(cn){className=cn}version=classes[className]}}return version};MetaLib.prototype.isClassRenamed=function(className){return this._renHist?this._renHist[className]:null};MetaLib.prototype.isClassDeprecated=function(className){var obj,ret=null;if(className==="oj.ojTree"){if(SemVer.gte(this._jetVer,"5.2.0")){return null}else{return"Use ojTreeView instead"}}obj=this._json[className];if(!obj){className=this._classChange[className];obj=className?this._json[className]:undefined}if(!obj){return false}if(obj&&obj.header){ret=this._isSubStateDeprecated(obj.header)}else{ret=this._isSubStateDeprecated(obj)}return ret};MetaLib.prototype.isClassMemberDeprecated=function(className,memName){var obj,member,ret=null;obj=this._json[className];memName=memName.charAt(0)===":"?memName.substr(1):memName;if(obj&&obj.member){for(member in obj.member){member=obj.member[member];if(memName===member.name){ret=this._isSubStateDeprecated(member);break}}}return ret};MetaLib.prototype.isClassMethodDeleted=function(className,methodName){var a,cn,i,ret=null;a=this._deletedMethods[methodName];if(a){cn=this._classChange[className];if(cn){className=cn}for(i=0;i<a.length;i++){if(a[i]===className){ret=a[i+1];break}i++}}return ret};MetaLib.prototype.isClassMethodDeprecated=function(className,methodName){var obj,method,ret=null;obj=this._json[className];if(!obj){className=this._classChange[className];obj=className?this._json[className]:undefined}if(obj&&obj.function){for(method in obj.function){if(method===methodName){method=obj.function[method];ret=this._isSubStateDeprecated(method);break}}}return ret};MetaLib.prototype.isClassMemberDeleted=function(className,memberName){var a,i,cname,ret=null;a=this._deletedMembers[memberName];if(a){cname=this._classChange[className];for(i=0;i<a.length;i++){if(a[i]===className||a[i]===cname){ret=a[i+1];break}i++}}return ret};MetaLib.prototype.isClassMemberDeprecated=function(className,memName){var obj,member,obj,ret=null;obj=this._json[className];if(!obj){className=this._classChange[className];obj=className?this._json[className]:undefined}memName=memName.charAt(0)===":"?memName.substr(1):memName;if(obj&&obj.member){for(member in obj.member){if(member===memName){member=obj.member[memName];ret=this._isSubStateDeprecated(member);break}}}return ret};MetaLib.prototype.isClassAttrDeprecated=function(className,attrName){var obj,member,ret=null;obj=this._json[className];attrName=attrName.charAt(0)===":"?attrName.substr(1):attrName;if(obj&&obj.member){for(member in obj.member){member=obj.member[member];if(attrName===member.name){ret=this._isSubStateDeprecated(member);break}}}return ret};MetaLib.prototype.isComponentDeleted=function(className){return this.isClassDeleted(className)};MetaLib.prototype.isComponentAttrDeprecated=function(className,attrName){return this.isClassAttrDeprecated(className,attrName)};MetaLib.prototype.isComponentMethodDeprecated=function(className,methodName){return this.isClassMethodDeprecated(className,methodName)};MetaLib.prototype.isComponentMemberDeprecated=function(className,memberName){return this.isClassMemberDeprecated(className,memberName)};MetaLib.prototype.isComponentMethodDeleted=function(className,methodName){return this.isClassMethodDeleted(className,methodName)};MetaLib.prototype.isComponentMemberDeleted=function(className,memberName){return this.isClassMemberDeleted(className,memberName)};MetaLib.prototype.hasTagDataOjCommand=function(tagName){var obj,ret=false,compName,containers,indexes,i;tagName=_removeChevrons(tagName);obj=this._getComponentFromTag(tagName);if(obj){compName=this._getComponentNameFromTag(tagName);indexes=this._json.dataOjCommand;if(indexes){containers=this._json.ojStyles.containers;for(i=0;i<indexes.length;i++){if(containers[indexes[i]]===compName){ret=true;break}}}}return ret};MetaLib.prototype.isTagEvent=function(tagName,eventName){var obj,ret=false;eventName=eventName.charAt(0)===":"?eventName.substr(1):eventName;if(!eventName.startsWith(EVENT_PREFIX)){return}if(this.isCCATag(tagName)){if(this._getComponentNameFromTag(tagName)){obj=this._getComponentFromTag(_removeChevrons(tagName));if(obj&&obj.htmlevents){ret=!!obj.htmlevents[eventName]}}else{ret=this._components&&this._components.isTagEvent(tagName,eventName)}}return ret};MetaLib.prototype.applySchema=function(obj){return this._compSvcs.validateComponentJsonWithSchema(obj)};MetaLib.prototype.walkDomStackForOJTag=function(context,excludeBindIf){var i,name,ret=null;var stack=context.elemStack;if(stack&&stack.length){for(i=stack.length-1;i>=0;i--){name=stack[i].name;if(name.toLowerCase().startsWith(OJPREFIX)){if(!name.startsWith("oj-bind-")||!excludeBindIf){ret=name;break}}}}return ret};MetaLib.prototype.getPublicInterface=function(){return{isJetTag:this.isJetTag.bind(this),isWCTag:this.isWCTag.bind(this),isComponentTag:this.isComponentTag.bind(this),isCCATag:this.isCCATag.bind(this),isTagDeprecated:this.isTagDeprecated.bind(this),isTagSupportedInTheme:this.isTagSupportedInTheme.bind(this),isAttrSupportedInTheme:this.isAttrSupportedInTheme.bind(this),isTagAttrDeprecated:this.isTagAttrDeprecated.bind(this),isTagAttrEnumValueDeprecated:this.isTagAttrEnumValueDeprecated.bind(this),isTagAttr:this.isTagAttr.bind(this),isJetTagAttr:this.isJetTagAttr.bind(this),hasTagAttrValues:this.hasTagAttrValues.bind(this),isTagAttrValue:this.isTagAttrValue.bind(this),isTagCompProp:this.isTagCompProp.bind(this),hasTagCompPropSubprop:this.hasTagCompPropSubprop.bind(this),getTagPropType:this.getTagPropType.bind(this),hasTagSlot:this.hasTagSlot.bind(this),isTagSlotValue:this.isTagSlotValue.bind(this),hasTagDataOjCommand:this.hasTagDataOjCommand.bind(this),isBindingTag:this.isBindingTag.bind(this),isClass:this.isClass.bind(this),isClassRenamed:this.isClassRenamed.bind(this),isClassDeleted:this.isClassDeleted.bind(this),isClassDeprecated:this.isClassDeprecated.bind(this),isClassMethodDeleted:this.isClassMethodDeleted.bind(this),isClassMemberDeleted:this.isClassMemberDeleted.bind(this),isClassMethodDeprecated:this.isClassMethodDeprecated.bind(this),isClassMemberDeprecated:this.isClassMemberDeprecated.bind(this),isClassAttrDeprecated:this.isClassAttrDeprecated.bind(this),isClassFinal:this.isClassFinal.bind(this),isClassMethod:this.isClassMethod.bind(this),isClassMethodStatic:this.isClassMethodStatic.bind(this),isClassMember:this.isClassMember.bind(this),isClassMemberStatic:this.isClassMemberStatic.bind(this),getClassMethodScope:this.getClassMethodScope.bind(this),getStyleOrigin:this.getStyleOrigin.bind(this),isJetStyle:this.isJetStyle.bind(this),isTagStyle:this.isTagStyle.bind(this),isStyle:this.isStyle.bind(this),isGenStyle:this.isGenStyle.bind(this),isClassStyle:this.isClassStyle.bind(this),isStylesetStyle:this.isStylesetStyle.bind(this),isStyleDeprecated:this.isStyleDeprecated.bind(this),getStyleSelector:this.getStyleSelector.bind(this),getNonSSStyleElems:this.getNonSSStyleElems.bind(this),isJetStylePrefix:this.isJetStylePrefix.bind(this),hasJetStylePrefixes:this.hasJetStylePrefixes.bind(this),isTagEvent:this.isTagEvent.bind(this),getTagsFromStyle:this.getTagsFromStyle.bind(this),getJetTagFromStyle:this.getJetTagFromStyle.bind(this),getJetTagsFromStyle:this.getJetTagsFromStyle.bind(this),getClassesFromStyle:this.getClassesFromStyle.bind(this),getClassFromTag:this.getClassFromTag.bind(this),getClassFromModule:this.getClassFromModule.bind(this),getTagFromClass:this.getTagFromClass.bind(this),getDeprecatedMethodList:this.getDeprecatedMethodList.bind(this),getDeprecatedMemberList:this.getDeprecatedMemberList.bind(this),getDeletedMethodList:this.getDeletedMethodList.bind(this),getDeletedMemberList:this.getDeletedMemberList.bind(this),getRequiredAttrs:this.getRequiredAttrs.bind(this),isComponent:this.isComponent.bind(this),isComponentDeprecated:this.isComponentDeprecated.bind(this),isComponentDeleted:this.isComponentDeleted.bind(this),isComponentMethodDeprecated:this.isComponentMethodDeprecated.bind(this),isComponentMethodDeleted:this.isComponentMethodDeleted.bind(this),isComponentMemberDeprecated:this.isComponentMemberDeprecated.bind(this),isComponentMemberDeleted:this.isComponentMemberDeleted.bind(this),isComponentAttrDeprecated:this.isComponentAttrDeprecated.bind(this),isNSRegistered:this.isNSRegistered.bind(this),isNamespacePrefix:this.isNamespacePrefix.bind(this),getRenamedClassList:this.getRenamedClassList.bind(this),getDeletedClassList:this.getDeletedClassList.bind(this),getMetaVers:this.getMetaVers.bind(this),walkDomStackForOJTag:this.walkDomStackForOJTag,isIgnoreAttr:this.isIgnoreAttr.bind(this),applySchema:this.applySchema.bind(this),getRevisionInfo:this.getRevisionInfo.bind(this)}};MetaLib.prototype.loadMeta=function(metaFile){var metaObj,ret=false;if(!this._json){try{metaObj=nodeDeps.metaLoader.loadMeta(metaFile,nodeDeps);if(metaObj){this._json=metaObj.meta;this._delHist=metaObj.delMeta;this._renHist=metaObj.renMeta;this._reqAttrs=metaObj.reqattr;this._jetVer=this._json.meta.jetversion;this._createNonClassList(this._json.meta);this._createModuleLookup();this._createClassNameChanges();this._fixup_jet_42315();ret=true}else{this._error("Metadata '"+metaFile+"' not found!")}}catch(e){this._error("["+e.name+"]: Metadata load ("+metaFile+") - "+e.message)}}return ret};MetaLib.prototype.getRenamedClassList=function(){return this._renHist};MetaLib.prototype.getDeletedClassList=function(){return this._delHist};const OJV_CHARS=/[<>]/;MetaLib.prototype._getOjValues=function(mem){var ts,ret;if(!mem){return false}if(mem.ojvalues){if(mem.ojvalues.name&&Array.isArray(mem.ojvalues.name)&&mem.ojvalues.name.length){return mem.ojvalues}return}if(mem.tstype&&mem.tstype.m_ojvalues){return mem.tstype.m_ojvalues}ts=this._getTsTypeObject(mem);if(ts&&ts.ojvalues&&ts.ojvalues.name){if(Array.isArray(ts.ojvalues.name)&&ts.ojvalues.name.length){ret=ts.ojvalues}}return ret};MetaLib.prototype._createNonClassList=function(mp){this._nonClasses=mp.nonClasses?mp.nonClasses:["genericStyles","ojStyles"];this._nonClasses.push("moduleLookup");this._nonClasses.push("newGenericStyles");this._nonClasses.push("newOjStyles");if(!this._nonClasses.includes("custElementClassLookup"))this._nonClasses.push("custElementClassLookup");if(!this._nonClasses.includes("meta"))this._nonClasses.push("meta");if(!this._nonClasses.includes("ResponsivePrefixes"))this._nonClasses.push("ResponsivePrefixes")};MetaLib.prototype.setAmdMeta=function(obj){this._json=obj.jetMeta.meta;this._delHist=obj.jetMeta.delMeta;this._reqAttrs=obj.jetMeta.reqattr;this._jetVer=this._json.meta.jetversion;this._createNonClassList(this._json.meta);this._createModuleLookup();return true};MetaLib.prototype.setTheme=function(theme){this._theme=theme};MetaLib.prototype._createModuleLookup=function(){var comps,compName,lookup,hdr;comps=this._json;this._json.moduleLookup=lookup={};for(compName in comps){if(!this._nonClasses.includes(compName)&&!compName.startsWith("oj.__")){hdr=comps[compName].header;if(hdr){if(hdr.memberof==="oj"){lookup[OJS+hdr.name.toLowerCase()]=compName}else{lookup[OJS+hdr.name.toLowerCase()]=compName}}}}};MetaLib.prototype._createClassNameChanges=function(){var comps,compName,o,hdr;comps=this._json;this._classChange=o={};for(compName in comps){if(!this._nonClasses.includes(compName)){hdr=comps[compName].header;if(hdr&&compName!==hdr.name){o[hdr.name]=compName}}}};MetaLib.prototype._fixup_jet_42315=function(){var o;if(SemVer.gte(this._jetVer,"8.0.0")){if(o=this._json.Color||this._json["oj.Color"]||this._json["oj.ojColor"]){if(!o.header){o.header={}}o.header.readonly=true}}};MetaLib.prototype.getMetaVers=function(){return{versions:this._jetVersions,runver:this._jetVer}};MetaLib.prototype.setComponentsLib=function(compSvcs,comps){this._compSvcs=compSvcs;if(comps){this._components=comps}};MetaLib.prototype.setStylesets=function(ss){if(!ss){return}var o,obj,e,i;if(!this._stylesets){this._stylesets=obj={}}else{obj=this._stylesheets}for(i=0;i<ss.length;i++){o=ss[i];if(typeof o==="string"){obj[o]=true}else if(o.deprecated){obj[o.deprecated]=e={};if(o.since){e.since=o.since}if(o.note){e.description=o.note}else if(o.description){e.description=o.description}}}};MetaLib.prototype.setDomUtils=function(du){this._domUtils=du};MetaLib.prototype.getRevisionInfo=function(){var metaSect=this._json.meta;var revision="";return{revision:revision,tag:metaSect.jetrevision,jetVersion:metaSect.jetversion,date:metaSect.date,time:metaSect.time}};MetaLib.prototype._isSubStateDeprecated=function(obj){var depr,prop,i,len,ret=null;if(!obj){return false}if(obj.deprecated){depr=obj.deprecated;if(depr){ret=typeof depr==="boolean"?NO_SUGGESTION_AVAIL:depr}}else{if(obj.ojdeprecated&&obj.ojdeprecated.length){depr=obj.ojdeprecated;len=depr.length;for(i=0;i<len;i++){prop=depr[i];if(!prop.target){if(prop.description){ret=prop.description;break}else if(prop.since){ret=NO_SUGGESTION_AVAIL;break}}}}}return ret};MetaLib.prototype._getComponentNameFromTag=function(tagName){tagName=tagName.toLowerCase();return this._json.custElementClassLookup[tagName]?this._json.custElementClassLookup[tagName]:null};MetaLib.prototype.isIgnoreAttr=function(tagName,attrName){var ret=false;attrName=attrName.toLowerCase();attrName=attrName.charAt(0)===":"?attrName.substr(1):attrName;if(HtmlUtils.isCommonElem(attrName)||attrName.startsWith("aria-")){return true}if(tagName==="oj-avatar"){if(attrName==="src"||attrName==="initials")ret=true}else if(tagName==="oj-option"){if(attrName==="value")ret=true}return ret};MetaLib.prototype.getDeprecatedMethodList=function(){if(this._deprecatedMethods){return this._deprecatedMethods}var json=this._json;var name,methName,methObj,o,a;var ret={};for(name in json){o=json[name];if(o&&o.function){for(methName in o.function){methObj=o.function[methName];if(methObj.ojdeprecated){if(ret[methName]){a=ret[methName]}else{ret[methName]=a=[]}a.push(name)}}}}return this._deprecatedMethods=ret};MetaLib.prototype.getDeprecatedMemberList=function(){if(this._deprecatedMembers){return this._deprecatedMembers}var json=this._json;var name,memName,memObj,o,a;var ret={};for(name in json){o=json[name];if(o&&o.member){for(memName in o.member){memObj=o.member[memName];if(memObj.ojdeprecated){if(ret[memName]){a=ret[memName]}else{ret[memName]=a=[]}a.push(name)}}}}return this._deprecatedMembers=ret};MetaLib.prototype.getDeletedMethodList=function(){if(this._deletedMethods){return this._deletedMethods}var json=this._delHist;var name,methName,ver,o,a;var ret={};if(json){for(name in json){o=json[name];if(o&&o.methods){for(methName in o.methods){ver=o.methods[methName];if(ret[methName]){a=ret[methName]}else{ret[methName]=a=[]}a.push(name);a.push(ver)}}}}return this._deletedMethods=ret};MetaLib.prototype.getDeletedMemberList=function(){if(this._deletedMembers){return this._deletedMembers}var json=this._delHist;var name,memName,ver,o,a;var ret={};if(json){for(name in json){o=json[name];if(o&&o.members){for(memName in o.members){ver=o.members[memName];if(ret[memName]){a=ret[memName]}else{ret[memName]=a=[]}a.push(name);a.push(ver)}}}}return this._deletedMembers=ret};MetaLib.prototype._getSlots=function(tagName){var obj=this._getComponentFromTag(_removeChevrons(tagName));return this._getSlots2(obj)};MetaLib.prototype._getSlots2=function(base){var bases,base,i,ret=null;while(base){ret=base&&base.slot?base.slot:null;if(ret){break}bases=base.header&&base.header.augments?base.header.augments:null;if(!bases){break}for(i=0;i<bases.length;i++){base=this._json[bases[i]];ret=this._getSlots2(base);if(ret){base=null;break}}}return ret?ret:null};MetaLib.prototype._getSlotByName=function(base,slotName){var ret=null;while(base){ret=base&&base.slot?base.slot:null;if(ret){ret=base.slot[slotName];if(ret){break}}break}return ret?ret:null};MetaLib.prototype._getComponentFromTag=function(tagName){var o=this._getComponentNameFromTag(tagName);if(o){o=this._json[o]}return o?o:null};function _getStyleIndices(scope,styleName){var a,n,ret,i;a=scope[styleName];if(a||a===0){if(!ret){ret=[]}if(Array.isArray(a)){for(i=0;i<a.length;i++){n=a[i];if(typeof n==="object"){n=a[i].index}ret.push(n)}}else{if(typeof a==="object"){n=a.index}else{n=a}ret.push(n)}}return ret&&ret.length?ret:null};MetaLib.prototype.getNonSSStyleElems=function(styleName,scope){var a,n,ret,i;scope=scope?this._json.ojStyles:this._json.genericStyles;a=scope[styleName];if(a||a===0){if(!ret){ret=[]}if(Array.isArray(a)){for(i=0;i<a.length;i++){n=a[i];if(typeof n==="object"&&!n.styleselector){n=a[i].index}ret.push(n)}}else{if(typeof a==="object"&&!a.styleselector){n=a.index}else{n=a}ret.push(n)}}return ret&&ret.length?_toContainers(scope,ret,this._json):null};function _toContainers(scope,indices,json){var cont,ret,clazz,elem,n,i;cont=scope.containers;for(i=0;i<indices.length;i++){n=indices[i];if(n>=0){if(!ret){ret=[]}if(!json){ret[i]=cont[n]}else{clazz=cont[n];elem=json[clazz];if(elem&&elem.header){elem=elem.header.customelement;if(elem){ret[i]=elem}}}}}return ret&&ret.length?ret:null};function _convertValue(valType,value){var retValue=value;if(valType==="string"){retValue=value}else if(valType==="number"){retValue=Number(value)}else if(valType==="boolean"){retValue=value.toLowerCase()==="true"}return retValue};function _removeChevrons(tagName){if(tagName&&tagName.length){if(tagName.charAt(0)==="<"){tagName=tagName.substr(1,tagName.length-1)}}return tagName};module.exports=MetaLib;
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2018, 2022, Oracle and/or its affiliates.
|
|
3
|
+
* Licensed under The Universal Permissive License (UPL), Version 1.0
|
|
4
|
+
* as shown at https://oss.oracle.com/licenses/upl/
|
|
5
|
+
*/
|
|
6
|
+
"use strict";const Namespaces=require("./ns");const HtmlUtils=require("./HtmlUtils");const SemVer=require("semver");var nodeDeps;const NO_SUGGESTION_AVAIL="No suggestion available.";const OJPREFIX="oj-";const OJEVENTPREFIX="on-oj-";const OJS="ojs/oj";const EVENT_PREFIX="on-";const DOT=".";const DATA_OJ_CMD="data-oj-command";const PROP_SLOTS="slots";const PROP_PROPS="props";const PROP_EVENTS="events";const PROP_IMPLEMENTS="implements";const PROP_FOLDER="folder";const PROP_VERSION="version";const PROP_UNSUP_THEME="unsupTheme";const PROP_SUBCOMPONENT_TYPE="subcomponentType";const PACK_PRIVATE="packPrivate";const DEPRECATED="deprecated";function MetaLib(nd,runMode,msgCtx,utils){this._json=null;this._delHist=null;this._renHist=null;this._reqAttrs=null;this._nonClasses=null;this._implements=null;this._hasJetWCIFCs=false;this._components=null;this._compSvcs=null;this._stylesets=null;this._runMode=runMode;this._utils=utils;this._domUtils=null;if(nd.jetver){this._jetVersions=nd.jetver.getVersions()}this._jetVer=null;this._theme=null;this._deprecatedMethods=null;this._deprecatedMembers=null;this._deletedMethods=null;this._deletedMembers=null;this._error=msgCtx.error;this._debug=msgCtx.debug;this._info=msgCtx.info;this._msg=msgCtx.msg;this._console=msgCtx.console;this._isDebug=msgCtx.isdebug;this._isVerbose=msgCtx.isVerbose;nodeDeps=nd};MetaLib.prototype.isNSRegistered=function(prefix){return Namespaces.has(prefix)};MetaLib.prototype.isNamespacePrefix=function(tagName){return HtmlUtils.isNamespaceTag(tagName)};MetaLib.prototype.isJetTag=function(tagName){return!!this._getComponentNameFromTag(_removeChevrons(tagName))};MetaLib.prototype.isComponentTag=function(tagName){return this._components&&this._components.isTag(_removeChevrons(tagName))};MetaLib.prototype.isWCTag=function(tagName){return this.isJetTag(tagName)||this.isComponentTag(tagName)};MetaLib.prototype.isCCATag=function(tagName){return this.isWCTag(tagName)};MetaLib.prototype.isTagDeprecated=function(tagName){var clazz,ret;if(clazz=this._getComponentNameFromTag(_removeChevrons(tagName))){ret=this.isClassDeprecated(clazz)}else{ret=this._components.isTagDeprecated(tagName)}return ret};MetaLib.prototype.isTagAttrDeprecated=function(tagName,attrName){var member,ret=null;member=this._getTagAttrMemberObj(tagName,attrName);ret=member?this._isSubStateDeprecated(member,true):this._components.isTagAttrDeprecated(tagName,attrName);if(ret){ret.forEach(status=>{if(status.description){status.description=HtmlUtils.replaceEntities(status.description)}})}return ret};MetaLib.prototype.isTagEventDeprecated=function(tag,attr){var x1,x2;if((x1=attr.indexOf("-"))<0){return false}attr=attr.substring(x1+1);if((x2=attr.lastIndexOf("-"))>=0){attr=attr.substring(0,x2)}return this.isTagAttrDeprecated(tag,attr)};MetaLib.prototype.isTagAttr=function(tagName,attrName){var o,ret=false;attrName=attrName.charAt(0)===":"?attrName.substr(1):attrName;if(this.isCCATag(tagName)){o=this._getComponentFromTag(tagName);if(o){ret=this.isJetTagAttr(o,attrName)}else{ret=this._components&&this._components.isTagAttr(tagName,attrName)}}return ret};MetaLib.prototype.isJetTagAttr=function(tagObj,attrName){attrName=attrName.charAt(0)===":"?attrName.substr(1):attrName;var ret=!!(tagObj.htmlattributes&&tagObj.htmlattributes[attrName]);if(!ret&&attrName===DATA_OJ_CMD&&tagObj.member){ret=!!tagObj.member[DATA_OJ_CMD]}return ret};MetaLib.prototype._getTagAttrMemberObj=function(tagName,attrName){var obj,attrib,member,x;obj=this._getComponentFromTag(_removeChevrons(tagName));attrName=attrName.charAt(0)===":"?attrName.substring(1):attrName;if(!obj||!obj.htmlattributes||!obj.htmlattributes[attrName]){return null}member=null;attrib=obj.htmlattributes[attrName];if(attrib){x=attrib.indexOf(DOT);if(x>=0){if(obj.member){member=this._findSubMember(obj,obj.member,attrib,attrib)}}else{member=obj.member[attrib];if(member){return member}}}return member};MetaLib.prototype._findSubMember=function(obj,mem,attrName,subMemberPart){var member,ts,sm,rest,x,ret=null;x=subMemberPart.indexOf(DOT);if(x>=0){sm=subMemberPart.substring(0,x);rest=subMemberPart.substring(x+1)}else{sm=subMemberPart;rest=null}for(member in mem){member=mem[member];if(member.name===attrName&&!rest){ret=member;break}if(member.name!==sm){continue}if(!rest){ret=member;break}if(member.submember){ret=this._findSubMember(obj,member.submember,attrName,rest);if(ret){break}}else if(member.tstype){ts=this._getTsTypeObject(member);if(ts){ret=this._findSubMember(obj,ts.member,attrName,rest);if(ret){break}}}if(ret){break}}return ret};MetaLib.prototype._getTsTypeObject=function(mem){var ts,o,s,x;ts=mem.tstype;if(ts&&ts.target==="Type"&&typeof ts.value==="string"){s=ts.value;s=s.replace("=","");x=s.indexOf("|");if(x>=0){s=s.substring(0,x).trimRight()}if(s.charAt(s.length-1)===">"){x=s.lastIndexOf("<");if(s>=0){s=s.substring(0,x)}}o=this._json[s];if(!o){o=this._json[mem.memberof];if(o.typedef){s=ts.value;x=s.lastIndexOf(DOT);if(x>=0){s=s.substring(x+1);o=o.typedef[s]}}}}return o?o:null};MetaLib.prototype._getSubMemberPart=function(fullAttr,soFar){var s,x;s=fullAttr.replace(soFar,"");if(s.length){if(s.charAt(0)==="."){x=s.indexOf(DOT,1);if(x>=0){s=soFar+s.substring(0,x)}else{s=soFar+s}}}else{s=soFar}return s};MetaLib.prototype._handleAttrObject=function(member){var link,types,i,x;types=member.tstype;if(types){for(i=0;i<types.length;i++){if(types[i].target==="Type"){link=types[i].value;link=link.replace("=","");x=link.indexOf("<K");if(x>=0){link=link.substring(0,x)}break}}}return link};MetaLib.prototype.hasTagAttrValues=function(tagName,attrName){var member,ojv,ret=false;member=this._getTagAttrMemberObj(tagName,attrName);if(member){ojv=this._getOjValues(member);return!!ojv}else if(this._components.isTag(tagName)){ret=this._components.hasTagAttrValues(tagName,attrName)}return ret};MetaLib.prototype.isTagAttrValue=function(tagName,attrName,attrValue){var member,ojv,values,curValue,valType,i,ret=false;member=this._getTagAttrMemberObj(tagName,attrName);if(member){ojv=this._getOjValues(member);if(ojv){values=ojv.name;for(i=0;i<values.length;i++){if(ojv.type){valType=ojv.type[i];curValue=_convertValue(valType,attrValue);ret=curValue===values[i]}else{ret=attrValue===values[i]}if(ret){break}}}else{ret=true}}else{if(this._components.isTag(tagName)){ret=this._components.isTagAttrValue(tagName,attrName,attrValue)}}return ret};MetaLib.prototype.isTagAttrEnumValueDeprecated=function(tagName,attrName,enumValue){var member,ojv,values,deps,dep,i,j,ret=null;member=this._getTagAttrMemberObj(tagName,attrName);if(!member){return this._isCompTagAttrEnumDepr(tagName,attrName,enumValue)}if(!member.ojdeprecated){return null}if(ojv=this._getOjValues(member)){values=ojv.name;for(i=0;i<values.length;i++){if(values[i]===enumValue){deps=member.ojdeprecated;for(j=0;j<deps.length;j++){dep=deps[j];if(dep.target==="propertyValue"&&dep.for===enumValue){ret={type:DEPRECATED,since:dep.since,description:dep.description};break}}}if(ret){break}}}return ret};MetaLib.prototype._isCompTagAttrEnumDepr=function(tagName,attrName,enumValue){return this._components?this._components.isTagAttrEnumDeprecated(tagName,attrName,enumValue):null};MetaLib.prototype.hasTagSlot=function(tagName){return this._getSlots(tagName)?true:false};MetaLib.prototype.hasDynamicTagSlot=function(tagName){};MetaLib.prototype.isTagSlotName=function(tagName,slotName){var tag,slot;tag=_removeChevrons(tagName);if(this.isJetTag(tagName)){slot=this._getSlotByName(this._getComponentFromTag(tag),slotName)}else if(this._components){if(!HtmlUtils.isCommonElem(tag)){slot=this._components.hasTagSlotName(tag,slotName)}}return!!slot};MetaLib.prototype.isTagSlotValue=function(tagName,slotName){return this.isTagSlotName(tagName,slotName)};MetaLib.prototype.isTagDynamicSlotValue=function(tagName,slotName){};MetaLib.prototype.getPreferredSlotContent=function(tag,slot){var ret;tag=_removeChevrons(tag);if(this.isJetTag(tag)){ret=this.getJetPreferredSlotContent(tag,slot)}else if(this._components&&this._implements){ret=this._components.getPreferredSlotContent(tag,slot,this._implements)}return ret};MetaLib.prototype.getJetPreferredSlotContent=function(tag,slot){var clazz,slot,prefContent,content,comps;if(!this._implements){return null}if(clazz=this._getComponentFromTag(tag)){if(clazz.slot){if(slot=clazz.slot[slot]){if(prefContent=slot.ojpreferredcontent){prefContent.forEach(impl=>{if(content=this._implements[impl]){if(!comps){comps=[]}comps.push(...content)}})}}}else{{let defMem;if(clazz.member&&(defMem=clazz.member["Default"])&&defMem.ojchild){if(prefContent=defMem.ojpreferredcontent){prefContent.forEach(impl=>{if(content=this._implements[impl]){if(!comps){comps=[]}comps.push(...content)}})}}}}}return prefContent||comps?{interfaces:prefContent,components:comps}:null};MetaLib.prototype.getTagSlotMetadata=function(tag,slot){var ret;tag=_removeChevrons(tag);if(this.isJetTag(tag)){ret=this._getJetTagSlotMetadata(tag,slot)}else if(this._components){ret=this._components.getTagSlotMetadata(tag,slot)}return ret};MetaLib.prototype._getJetTagSlotMetadata=function(tag,slot){};MetaLib.prototype.isTagSupportedInTheme=function(tag){var o,a,ret=true;o=this._getComponentFromTag(tag);if(o){if(o.header){a=o.header.ojunsupportedthemes;ret=!(a&&a.includes(this._theme))}}else{ret=this._components&&this._components.isTagSupportedInTheme(tag,this._theme)}return ret};MetaLib.prototype.isAttrSupportedInTheme=function(tag,attr){var o,a,ret=true;o=this._getTagAttrMemberObj(tag,attr);if(o){a=o.ojunsupportedthemes;ret=!(a&&a.includes(this._theme))}else{ret=this._components.isAttrSupportedInTheme(tag,attr,this._theme)}return ret};MetaLib.prototype.hasTagCompPropSubprop=function(tagName,propName){var obj,ret=false;if(this.isCCATag(tagName)){obj=this._getComponentFromTag(tagName);if(obj&&obj.member){ret=obj.member[propName];ret=ret&&ret.submember}else if(this._components){ret=this._components.getTagProp(tagName,propName);ret=ret&&ret.properties}}return ret};MetaLib.prototype.isTagCompProp=function(tagName,propName){var obj,ret=false;if(this.isCCATag(tagName)){obj=this._getComponentFromTag(tagName);if(obj&&obj.member){ret=obj.member[propName]}else if(this._components){ret=this._components.isTagProp(tagName,propName)}}return ret};MetaLib.prototype.getTagAttrType=function(tag,attr){var member=this._getTagAttrMemberObj(tag,attr);return member?member.type:this._components.getTagPropType(tag,attr)};MetaLib.prototype.getTagPropType=function(tagName,propName){var ret;if(this._components){ret=this._components.getTagPropType(tagName,propName)}return ret};MetaLib.prototype.getTagAttrMetadata=function(tag,attr){var obj,member,req;var member=this._getTagAttrMemberObj(tag,attr);if(!member){if(this._components){obj=this._components.getTagProp(tag,attr)}}else{obj={type:member.type};if(member.deprecated||member.ojdeprecated){obj.deprecated=true}if(member.ojtranslatable){obj.translatable=true}if(req=this.getRequiredAttrs(tag)){for(let i=0;i<req.length;i++){if(req[i]===attr){obj.required=true;break}}}obj.type=member.type}return obj};MetaLib.prototype.getTagMetadata=function(tag){var obj,comp,hdr,events,props,event,ret;obj=this._getComponentFromTag(_removeChevrons(tag));if(obj){if(hdr=obj.hdr){comp={};comp.name=hdr.customelement;if(hdr.slot){comp[PROP_SLOTS]=obj.slots}}if(obj.properties){comp[PROP_PROPS]=props={};this._extractProps(props,null,obj.properties,obj.name)}if(obj.events){comp[PROP_EVENTS]=events={};for(event in obj.events){}}if(obj.implements){comp[PROP_IMPLEMENTS]=obj.implements}if(obj.extension&&obj.extension.theme&&obj.extension.theme.unsupportedThemes){comp[PROP_UNSUP_THEME]=obj.extension.theme.unsupportedThemes}if(hdr&&hdr.ojsubcomponenttype){comp[PROP_SUBCOMPONENT_TYPE]=hdr.subcomponenttype}}else if(this._components){ret=this._components.getTagMetadata(tag)}return ret};MetaLib.prototype.isTagStyleDeprecated=function(tagName,styleName){var o,ret;o=this.isWCStyleDeprecated(styleName);if(o){tagName=_removeChevrons(tagName);if(this._json.ojStyles.containers[o.index]===tagName){ret=o.dep.description}}return ret};MetaLib.prototype.isTagStyle=function(tagName,styleName){var obj,ret=false,compName,containers,indices,index,i;tagName=_removeChevrons(tagName);obj=this._getComponentFromTag(tagName);if(obj){compName=this._getComponentNameFromTag(tagName);containers=this._json.ojStyles.containers;indices=_getStyleIndices(this._json.ojStyles,styleName);if(indices){for(i=0;i<indices.length;i++){index=indices[i];if(index>=0){if(containers[index]===compName){ret=true;break}}}}}return!!ret};MetaLib.prototype.isStyle=function(style){return this.isGenStyle(style)||this.isClassStyle(style)||this.isStylesetStyle(style)};MetaLib.prototype.isGenStyle=function(style){var x=this._json.genericStyles[style];return x||x===0?true:false};MetaLib.prototype.isJetStyle=function(style){return this._json.genericStyles[style]?"g":this._json.ojStyles[style]?"j":undefined};MetaLib.prototype.isCustomStyle=function(style){return this._components&&this._components.isStyle(style)};MetaLib.prototype.getStyleOrigin=function(style){var ret;if(this._json.genericStyles[style]){ret="g"}if(this._json.ojStyles[style]){ret=ret?"b":"j"}if(!ret&&this._components){if(this._components.isStyle(style)){ret="c"}}return ret};MetaLib.prototype.isClassStyle=function(style){var x=this._json.ojStyles[style];return x||x===0?true:false};MetaLib.prototype.isStylesetStyle=function(style){return this._stylesets?!!this._stylesets[style]:false};MetaLib.prototype.getStyleSelector=function(style,jet){var o,i,ret;if(typeof jet==="boolean"){o=jet?this._json.ojStyles[style]:this._json.genericStyles[style]}else{o=this._json.ojStyles[style];if(!o&&o!==0){o=this._json.genericStyles[style]}if(!o&&this._components){o=this._components.getStyleMetadata(style)}}if(this._utils.isObject(o)){if(o.styleselector){ret=o.styleselector}else if(o.meta){ret=o.meta.styleSelector}}else if(Array.isArray(o)){for(i=0;i<o.length;i++){if(this._utils.isObject(o[i])&&o[i].styleselector){if(!ret){ret=[]}ret.push(o[i].styleselector)}}if(ret&&ret.length===1){ret=ret[0]}}return ret?ret:null};MetaLib.prototype.isJetStylePrefix=function(s){var x;if(!s.startsWith(OJPREFIX)||!this._json.jetCssPrefixes.classes){return false}x=s.indexOf("-",3);if(x>=0){s=s.substring(0,x)}return this._json.jetCssPrefixes.classes.includes(s)};MetaLib.prototype.hasJetStylePrefixes=function(){return this._json.jetCssPrefixes&&this._json.jetCssPrefixes.classes};MetaLib.prototype.getClassesFromStyle=function(styleName,scope){var indices,oStyles,ret;scope=scope||"oj";if(scope==="oj"||scope==="both"){oStyles=this._json.ojStyles;if(oStyles){indices=_getStyleIndices(oStyles,styleName);if(indices){return _toContainers(oStyles,indices)}}}if(scope==="gen"||scope==="both"){oStyles=this._json.genericStyles;if(oStyles){indices=_getStyleIndices(oStyles,styleName);if(indices){ret=_toContainers(oStyles,indices)}}}return ret?ret:null};MetaLib.prototype.getJetTagFromStyle=function(styleName){var indices,oStyles,clazz;oStyles=this._json.ojStyles;if(oStyles){indices=_getStyleIndices(oStyles,styleName)}if(indices){if(indices.length>1||indices.length===0){clazz=null}else{clazz=this.isGenStyle(styleName)?null:_toContainers(oStyles,indices)}}return clazz?this.getTagFromClass(clazz):null};MetaLib.prototype.getJetTagsFromStyle=function(styleName){var indices,oStyles;oStyles=this._json.ojStyles;if(oStyles){indices=_getStyleIndices(oStyles,styleName);if(indices){return _toContainers(oStyles,indices,this._json)}}return null};MetaLib.prototype.getClassFromTag=function(tagName){return this._getComponentNameFromTag(_removeChevrons(tagName))};MetaLib.prototype.getClassFromModule=function(module){var clazz=this._json.moduleLookup[module];return clazz?clazz:null};MetaLib.prototype.getTagFromClass=function(className){if(className==="oj.ojTree"){return"oj-tree"}let ret=this._json[className];return ret&&ret.header?ret.header.customelement:null};MetaLib.prototype.isClass=function(className){var b=this._json[className];if(!b){if(className=this._classChange[className]){b=this._json[className]}}return!!b};MetaLib.prototype.isClassFinal=function(className){var clazz=this._json[className];if(!clazz){if(className=this._classChange[className]){clazz=this._json[className]}}return clazz&&clazz.header&&clazz.header.readonly};MetaLib.prototype.isClassMethod=function(className,methName){var clazz=this._json[className];return!!(clazz&&clazz.function&&clazz.function[methName])};MetaLib.prototype.isClassMethodStatic=function(className,methName){var meth,ret=null;var clazz=this._json[className];if(clazz&&clazz.function){meth=clazz.function[methName];ret=meth&&meth.scope&&meth.scope=="static"}return ret};MetaLib.prototype.getClassMethodScope=function(className,methName){var meth,ret=null;var clazz=this._json[className];if(clazz&&clazz.function){meth=clazz.function[methName];ret=meth.scope}return ret};MetaLib.prototype.isClassMember=function(className,memName){var clazz=this._json[className];return!!(clazz&&clazz.member&&clazz.member[memName])};MetaLib.prototype.isClassMemberStatic=function(className,memName){var mem,ret=null;var clazz=this._json[className];if(clazz&&clazz.member){mem=clazz.member[memName];ret=mem&&mem.scope&&mem.scope=="static"}return ret};MetaLib.prototype.getRequiredAttrs=function(tagName){let obj,clazz,i,ret=null;tagName=_removeChevrons(tagName);obj=this._getComponentFromTag(tagName);if(obj){clazz=this._getComponentNameFromTag(tagName)}ret=obj?this._reqAttrs[clazz]:this._components.getRequiredAttrs(tagName);if(obj&&ret&&ret.length){for(i=0;i<ret.length;i++){ret[i]=this._domUtils.kebabCase(ret[i])}}return ret};MetaLib.prototype.getTagsFromStyle=function(styleName){var classNames,tag,i,ret;ret=null;classNames=this.getClassesFromStyle(styleName);if(classNames){for(i=0;i<classNames.length;i++){tag=this.getTagFromClass(classNames[i]);if(tag){if(!ret){ret=[]}ret.push(tag)}}}return ret?ret:null};MetaLib.prototype.isStyleDeprecated=function(name){var s,o,t,i;s=this._json.genericStyles[name];if(!s&&s!==0&&this._json.ojStyles){s=this._json.ojStyles[name];if(!s&&s!==0&&this._stylesets){s=this._stylesets[name];return this._utils.isObject(s)?s:null}}if(s){t=typeof s;if(Array.isArray(s)){for(i=0;i<s.length;i++){o=s[0];if(typeof o==="object"){break}}}else if(t==="object"){o=s}else{o=null}}return o?o.dep:null};MetaLib.prototype.isStyleDeprecatedEx=function(style){var a=null,ss,t,i;function _pushSS(o){if(o.dep){if(!a){a=[]}a.push(o)}};function _stashSS(s){t=typeof s;if(Array.isArray(s)){for(i=0;i<s.length;i++){_pushSS(s[i])}}else if(t==="object"){_pushSS(s)}};if(ss=this._json.genericStyles[style]){_stashSS(ss)}if(ss=this._json.ojStyles[style]){_stashSS(ss)}else if(ss!==0&&this._stylesets){ss=this._stylesets[style];return this._utils.isObject(ss)?ss:null}return a};MetaLib.prototype.isWCStyleDeprecated=function(name){var s,o,t,i;s=this._json.ojStyles[name];if(s){t=typeof s;if(Array.isArray(s)){for(i=0;i<s.length;i++){o=s[i];if(typeof o==="object"){break}o=null}}else if(t==="object"){o=s}}return o?o:null};MetaLib.prototype.isBindingTag=function(tagName){var obj=this._getComponentFromTag(_removeChevrons(tagName));return obj&&obj.header?!!obj.header.ojbindingelement:false};MetaLib.prototype.isComponent=function(className){var obj=this._json[className];if(!obj){if(!className.startsWith("oj.")){obj=this._json["oj."+className]}}return!!obj};MetaLib.prototype.isClass=function(className){return!!this._json[className]};MetaLib.prototype.isJetComponentClass=function(className){return this.isClass(className)};MetaLib.prototype.isComponentDeprecated=function(className){return this.isClassDeprecated(className)};MetaLib.prototype.isClassDeleted=function(className){var classes,cn,version=null;if(this._delHist){if(classes=this._delHist.classes){cn=this._classChange[className];if(cn){className=cn}version=classes[className]}}return version};MetaLib.prototype.isClassRenamed=function(className){return this._renHist?this._renHist[className]:null};MetaLib.prototype.isClassDeprecated=function(className){var obj,ret=null;if(className==="oj.ojTree"){if(SemVer.gte(this._jetVer,"5.2.0")){return null}else{return{type:DEPRECATED,description:"Use ojTreeView instead"}}}if(!(obj=this._json[className])){className=this._classChange[className];obj=className?this._json[className]:undefined}if(!obj){return false}if(obj.header){ret=this._isClassDeprecated(obj.header)}if(!ret){ret=this._isClassDeprecated(obj)}return ret};MetaLib.prototype._isClassDeprecated=function(obj){var depr,status,ret=null;if(obj){if(obj.ojdeprecated&&obj.ojdeprecated.length){depr=obj.ojdeprecated;for(status of depr){ret=status;break}}else if(depr=obj.deprecated){ret={type:DEPRECATED,description:typeof depr==="boolean"?NO_SUGGESTION_AVAIL:depr}}}return ret};MetaLib.prototype.isClassMethodDeleted=function(className,methodName){var a,cn,i,ret=null;a=this._deletedMethods[methodName];if(a){cn=this._classChange[className];if(cn){className=cn}for(i=0;i<a.length;i++){if(a[i]===className){ret=a[i+1];break}i++}}return ret};MetaLib.prototype.isClassMethodDeprecated=function(className,methodName){var obj,method,ret=null;obj=this._json[className];if(!obj){className=this._classChange[className];obj=className?this._json[className]:undefined}if(obj&&obj.function){for(method in obj.function){if(method===methodName){method=obj.function[method];ret=this._isSubStateDeprecated(method);break}}}return ret};MetaLib.prototype.isClassMemberDeleted=function(className,memberName){var a,i,cname,ret=null;a=this._deletedMembers[memberName];if(a){cname=this._classChange[className];for(i=0;i<a.length;i++){if(a[i]===className||a[i]===cname){ret=a[i+1];break}i++}}return ret};MetaLib.prototype.isClassMemberDeprecated=function(className,memName){var obj,member,obj,ret=null;obj=this._json[className];if(!obj){className=this._classChange[className];obj=className?this._json[className]:undefined}if(obj&&obj.member){memName=memName.charAt(0)===":"?memName.substr(1):memName;for(member in obj.member){if(member===memName){member=obj.member[memName];ret=this._isSubStateDeprecated(member,true);break}}}return ret};MetaLib.prototype.isClassAttrDeprecated=function(className,attrName){var obj,member,ret=null;obj=this._json[className];attrName=attrName.charAt(0)===":"?attrName.substr(1):attrName;if(obj&&obj.member){for(member in obj.member){member=obj.member[member];if(attrName===member.name){ret=this._isSubStateDeprecated(member,true);break}}}return ret};MetaLib.prototype.isComponentDeleted=function(className){return this.isClassDeleted(className)};MetaLib.prototype.isComponentAttrDeprecated=function(className,attrName){return this.isClassAttrDeprecated(className,attrName)};MetaLib.prototype.isComponentMethodDeprecated=function(className,methodName){return this.isClassMethodDeprecated(className,methodName)};MetaLib.prototype.isComponentMemberDeprecated=function(className,memberName){return this.isClassMemberDeprecated(className,memberName)};MetaLib.prototype.isComponentMethodDeleted=function(className,methodName){return this.isClassMethodDeleted(className,methodName)};MetaLib.prototype.isComponentMemberDeleted=function(className,memberName){return this.isClassMemberDeleted(className,memberName)};MetaLib.prototype.isTagPackPrivate=function(tag){var o,ret;tag=_removeChevrons(tag);if(this.isJetTag(tag)){if(o=this._getComponentFromTag(tag)){ret=o.header&&o.header.ojsubcomponenttype===PACK_PRIVATE}}else if(this._components){ret=this._components.isTagPackPrivate(tag)}return ret};MetaLib.prototype.isTagAttrTranslatable=function(tag,attr){var member=this._getTagAttrMemberObj(tag,attr);return member?this._isSubStateTranslatable(member):this._components.isTagAttrTranslatable(tag,attr)};MetaLib.prototype.isTagAttrReadOnly=function(tag,attr){var o,ret=false;tag=_removeChevrons(tag);if(o=this._getTagAttrMemberObj(tag,attr)){ret=o&&o.readonly}else if(this._components){ret=this._components.isTagAttrReadOnly(tag,attr)}return ret};MetaLib.prototype.hasTagDataOjCommand=function(tagName){var obj,ret=false,compName,containers,indexes,i;tagName=_removeChevrons(tagName);obj=this._getComponentFromTag(tagName);if(obj){compName=this._getComponentNameFromTag(tagName);indexes=this._json.dataOjCommand;if(indexes){containers=this._json.ojStyles.containers;for(i=0;i<indexes.length;i++){if(containers[indexes[i]]===compName){ret=true;break}}}}return ret};MetaLib.prototype.isTagEvent=function(tagName,eventName){var obj,attr,x,ret=false;eventName=eventName.charAt(0)===":"?eventName.substr(1):eventName;if(!eventName.startsWith(EVENT_PREFIX)){return ret}if(this.isWCTag(tagName)){if(this._getComponentNameFromTag(tagName)){obj=this._getComponentFromTag(_removeChevrons(tagName));if(obj&&obj.htmlevents){ret=!!obj.htmlevents[eventName]}if(!ret){if((x=eventName.lastIndexOf("-changed"))>=0){attr=eventName.substring(3,x);attr=this._domUtils.camelCase(attr);ret=!!obj.member[attr]}}}else{ret=this._components&&this._components.isTagEvent(tagName,eventName)}if(!ret){ret=HtmlUtils.isCommonEventAttr(eventName)}}return ret};MetaLib.prototype.applySchema=function(obj){return this._compSvcs.validateComponentJsonWithSchema(obj)};MetaLib.prototype.walkElemStackForOJTag=function(ctx,excludeBindIf){var i,name,ret=null;var stack=ctx.elemStack;if(stack&&stack.length){for(i=stack.length-1;i>=0;i--){name=stack[i].name;if(name.toLowerCase().startsWith(OJPREFIX)){if(!name.startsWith("oj-bind-")||!excludeBindIf){ret=name;break}}}}return ret};MetaLib.prototype.walkDomStackForOJTag=function(ctx,excludeBindIf){return this.walkElemStackForOJTag(ctx,excludeBindIf)};MetaLib.prototype.getPublicInterface=function(){return{isJetTag:this.isJetTag.bind(this),isWCTag:this.isWCTag.bind(this),isComponentTag:this.isComponentTag.bind(this),isTagDeprecated:this.isTagDeprecated.bind(this),isTagSupportedInTheme:this.isTagSupportedInTheme.bind(this),isAttrSupportedInTheme:this.isAttrSupportedInTheme.bind(this),isTagAttrDeprecated:this.isTagAttrDeprecated.bind(this),isTagAttrTranslatable:this.isTagAttrTranslatable.bind(this),isTagAttrReadOnly:this.isTagAttrReadOnly.bind(this),isTagEventDeprecated:this.isTagEventDeprecated.bind(this),isTagAttrEnumValueDeprecated:this.isTagAttrEnumValueDeprecated.bind(this),isTagAttr:this.isTagAttr.bind(this),isJetTagAttr:this.isJetTagAttr.bind(this),hasTagAttrValues:this.hasTagAttrValues.bind(this),isTagAttrValue:this.isTagAttrValue.bind(this),getTagAttrType:this.getTagAttrType.bind(this),getTagAttrMetadata:this.getTagAttrMetadata.bind(this),getTagMetadata:this.getTagMetadata.bind(this),isTagCompProp:this.isTagCompProp.bind(this),hasTagCompPropSubprop:this.hasTagCompPropSubprop.bind(this),getTagPropType:this.getTagPropType.bind(this),hasTagSlot:this.hasTagSlot.bind(this),isTagSlotName:this.isTagSlotName.bind(this),isTagSlotValue:this.isTagSlotValue.bind(this),getPreferredSlotContent:this.getPreferredSlotContent.bind(this),getTagSlotMetadata:this.getTagSlotMetadata.bind(this),hasTagDataOjCommand:this.hasTagDataOjCommand.bind(this),isBindingTag:this.isBindingTag.bind(this),isTagPackPrivate:this.isTagPackPrivate.bind(this),isClass:this.isClass.bind(this),isClassRenamed:this.isClassRenamed.bind(this),isClassDeleted:this.isClassDeleted.bind(this),isClassDeprecated:this.isClassDeprecated.bind(this),isClassMethodDeleted:this.isClassMethodDeleted.bind(this),isClassMemberDeleted:this.isClassMemberDeleted.bind(this),isClassMethodDeprecated:this.isClassMethodDeprecated.bind(this),isClassMemberDeprecated:this.isClassMemberDeprecated.bind(this),isClassAttrDeprecated:this.isClassAttrDeprecated.bind(this),isClassFinal:this.isClassFinal.bind(this),isClassMethod:this.isClassMethod.bind(this),isClassMethodStatic:this.isClassMethodStatic.bind(this),isClassMember:this.isClassMember.bind(this),isClassMemberStatic:this.isClassMemberStatic.bind(this),getClassMethodScope:this.getClassMethodScope.bind(this),getStyleOrigin:this.getStyleOrigin.bind(this),isJetStyle:this.isJetStyle.bind(this),isCustomStyle:this.isCustomStyle.bind(this),isTagStyle:this.isTagStyle.bind(this),isStyle:this.isStyle.bind(this),isGenStyle:this.isGenStyle.bind(this),isClassStyle:this.isClassStyle.bind(this),isStylesetStyle:this.isStylesetStyle.bind(this),isStyleDeprecated:this.isStyleDeprecated.bind(this),isStyleDeprecatedEx:this.isStyleDeprecatedEx.bind(this),getStyleSelector:this.getStyleSelector.bind(this),getNonSSStyleElems:this.getNonSSStyleElems.bind(this),isJetStylePrefix:this.isJetStylePrefix.bind(this),hasJetStylePrefixes:this.hasJetStylePrefixes.bind(this),isTagEvent:this.isTagEvent.bind(this),getTagsFromStyle:this.getTagsFromStyle.bind(this),getJetTagFromStyle:this.getJetTagFromStyle.bind(this),getJetTagsFromStyle:this.getJetTagsFromStyle.bind(this),getClassesFromStyle:this.getClassesFromStyle.bind(this),getClassFromTag:this.getClassFromTag.bind(this),getClassFromModule:this.getClassFromModule.bind(this),getTagFromClass:this.getTagFromClass.bind(this),getDeprecatedMethodList:this.getDeprecatedMethodList.bind(this),getDeprecatedMemberList:this.getDeprecatedMemberList.bind(this),getDeletedMethodList:this.getDeletedMethodList.bind(this),getDeletedMemberList:this.getDeletedMemberList.bind(this),getRequiredAttrs:this.getRequiredAttrs.bind(this),isComponent:this.isComponent.bind(this),isNSRegistered:this.isNSRegistered.bind(this),isNamespacePrefix:this.isNamespacePrefix.bind(this),getRenamedClassList:this.getRenamedClassList.bind(this),getDeletedClassList:this.getDeletedClassList.bind(this),processImplements:this.processImplements.bind(this),getWCInterfaces:this.getWCInterfaces.bind(this),hasWCInterfaces:this.hasWCInterfaces.bind(this),hasJetWCInterfaces:this.hasJetWCInterfaces.bind(this),getMetaVers:this.getMetaVers.bind(this),walkElemStackForOJTag:this.walkelemStackForOJTag,walkDomStackForOJTag:this.walkDomStackForOJTag,isIgnoreAttr:this.isIgnoreAttr.bind(this),applySchema:this.applySchema.bind(this),getRevisionInfo:this.getRevisionInfo.bind(this)}};MetaLib.prototype.loadMeta=function(metaFile){var metaObj,ret=false;if(!this._json){try{if(metaObj=nodeDeps.metaLoader.loadMeta(metaFile,nodeDeps)){this._json=metaObj.meta;this._delHist=metaObj.delMeta;this._renHist=metaObj.renMeta;this._reqAttrs=metaObj.reqattr;this._jetVer=this._json.meta.jetversion;this._createNonClassList(this._json.meta);this._createModuleLookup();this._createClassNameChanges();this._fixup_jet_42315();this._createImplements();ret=true}else{this._error(`Metadata '${metaFile}' not found!`)}}catch(e){this._error(`[${e.name}]: Metadata load (${metaFile}) - ${e.message}`)}}return ret};MetaLib.prototype.getRenamedClassList=function(){return this._renHist};MetaLib.prototype.getDeletedClassList=function(){return this._delHist};MetaLib.prototype.processImplements=function(tag,impls){if(Array.isArray(impls)&&this._implements){impls.forEach(impl=>{if(this._implements[impl]){this._implements[impl].push(tag)}else{this._implements[impl]=[tag]}})}};const OJV_CHARS=/[<>]/;MetaLib.prototype._getOjValues=function(mem){var ts,ret;if(!mem){return false}if(mem.ojvalues){if(mem.ojvalues.name&&Array.isArray(mem.ojvalues.name)&&mem.ojvalues.name.length){return mem.ojvalues}return}if(mem.tstype&&mem.tstype.m_ojvalues){return mem.tstype.m_ojvalues}ts=this._getTsTypeObject(mem);if(ts&&ts.ojvalues&&ts.ojvalues.name){if(Array.isArray(ts.ojvalues.name)&&ts.ojvalues.name.length){ret=ts.ojvalues}}return ret};MetaLib.prototype.getWCInterfaces=function(){return this._implements};MetaLib.prototype.hasJetWCInterfaces=function(){return this._hasJetWCIFCs};MetaLib.prototype.hasWCInterfaces=function(){return!!this._implements};MetaLib.prototype._createNonClassList=function(mp){this._nonClasses=mp.nonClasses?mp.nonClasses:["genericStyles","ojStyles"];this._nonClasses.push("moduleLookup");this._nonClasses.push("newGenericStyles");this._nonClasses.push("newOjStyles");if(!this._nonClasses.includes("custElementClassLookup"))this._nonClasses.push("custElementClassLookup");if(!this._nonClasses.includes("meta"))this._nonClasses.push("meta");if(!this._nonClasses.includes("ResponsivePrefixes"))this._nonClasses.push("ResponsivePrefixes")};MetaLib.prototype.setAmdMeta=function(obj){this._json=obj.jetMeta.meta;this._delHist=obj.jetMeta.delMeta;this._reqAttrs=obj.jetMeta.reqattr;this._jetVer=this._json.meta.jetversion;this._createNonClassList(this._json.meta);this._createModuleLookup();return true};MetaLib.prototype.setTheme=function(theme){this._theme=theme};MetaLib.prototype._createModuleLookup=function(){var comps,compName,lookup,hdr;if(this._json.moduleLookup){return}this._json.moduleLookup=lookup={};comps=this._json;for(compName in comps){if(!this._nonClasses.includes(compName)&&!compName.startsWith("oj.__")){hdr=comps[compName].header;if(hdr){lookup[OJS+hdr.name.toLowerCase()]=compName}}}};MetaLib.prototype._createClassNameChanges=function(){var comps,compName,o,hdr;if(this._classChange=this._json.meta.isClassNameChanges){return}this._classChange=o={};comps=this._json;for(compName in comps){if(!this._nonClasses.includes(compName)){hdr=comps[compName].header;if(hdr&&compName!==hdr.name){o[hdr.name]=compName}}}this._json.meta.isClassNameChanges=true};MetaLib.prototype._fixup_jet_42315=function(){var o;if(SemVer.gte(this._jetVer,"8.0.0")){if(o=this._json.Color||this._json["oj.Color"]||this._json["oj.ojColor"]){if(!o.header){o.header={}}o.header.readonly=true}}};MetaLib.prototype._createImplements=function(){var clazzes,clazz,tag,impls,impl,o={},a,hdr;if(this._implements=this._json.meta.interfaces){return}clazzes=this._json;for(clazz in clazzes){if(this._nonClasses.includes(clazz)){continue}if(hdr=clazzes[clazz].header){if(hdr.domInterface&&hdr.customelement){impls=hdr.domInterface;impls=Array.isArray(impls)?impls:[impls];for(impl of impls){if(o[impl]){a=o[impl]}else{o[impl]=a=[]}this._hasJetWCIFCs=true;tag=this.getTagFromClass(clazz);if(tag&&!a.includes(tag)){a.push(tag)}}}}}this._implements=this._hasJetWCIFCs?o:null};MetaLib.prototype.getMetaVers=function(){return{versions:this._jetVersions,runver:this._jetVer}};MetaLib.prototype.setComponentsLib=function(compSvcs,comps){if(compSvcs){this._compSvcs=compSvcs}if(comps){this._components=comps}};MetaLib.prototype.setStylesets=function(ss){if(!ss){return}var o,obj,e,i;if(!this._stylesets){this._stylesets=obj={}}else{obj=this._stylesheets}for(i=0;i<ss.length;i++){o=ss[i];if(typeof o==="string"){obj[o]=true}else if(o.deprecated){obj[o.deprecated]=e={};if(o.since){e.since=o.since}if(o.note){e.description=o.note}else if(o.description){e.description=o.description}}}};MetaLib.prototype.setDomUtils=function(du){this._domUtils=du};MetaLib.prototype.getRevisionInfo=function(){var metaSect=this._json.meta;var revision="";return{revision:revision,tag:metaSect.jetrevision,jetVersion:metaSect.jetversion,date:metaSect.date,time:metaSect.time}};MetaLib.prototype._isSubStateDeprecated=function(obj,isMember){var depr,retStatus=null,o;if(!obj){return false}if(obj.ojdeprecated&&obj.ojdeprecated.length){retStatus=[];depr=obj.ojdeprecated;depr.forEach(status=>{o={type:DEPRECATED};if(status.hasOwnProperty("target")){o.target=status.target;if(isMember&&status.target==="memberType"){o.target="propertyType"}}if(status.hasOwnProperty("description")){o.description=status.description}if(status.hasOwnProperty("since")){o.since=status.since}if(status.hasOwnProperty("for")){o.value=[status.for]}else if(status.hasOwnProperty("value")){o.value=status.value}retStatus.push(o)});retStatus=retStatus.length?retStatus:null}else if(depr=obj.deprecated){retStatus=typeof depr==="boolean"?NO_SUGGESTION_AVAIL:depr;retStatus=[{type:DEPRECATED,description:retStatus}]}return retStatus};MetaLib.prototype._isSubStateTranslatable=function(obj){return obj&&obj.ojtranslatable};MetaLib.prototype._getComponentNameFromTag=function(tagName){tagName=tagName.toLowerCase();return this._json.custElementClassLookup[tagName]?this._json.custElementClassLookup[tagName]:null};MetaLib.prototype.isIgnoreAttr=function(tagName,attrName){var ret=false;attrName=attrName.toLowerCase();attrName=attrName.charAt(0)===":"?attrName.substr(1):attrName;if(HtmlUtils.isCommonElem(attrName)||attrName.startsWith("aria-")){return true}if(tagName==="oj-avatar"){if(attrName==="src"||attrName==="initials")ret=true}else if(tagName==="oj-option"){if(attrName==="value")ret=true}return ret};MetaLib.prototype.getDeprecatedMethodList=function(){if(this._deprecatedMethods){return this._deprecatedMethods}var json=this._json;var name,methName,methObj,o,a;var ret={};for(name in json){o=json[name];if(o&&o.function){for(methName in o.function){methObj=o.function[methName];if(methObj.ojdeprecated){if(ret[methName]){a=ret[methName]}else{ret[methName]=a=[]}a.push(name)}}}}return this._deprecatedMethods=ret};MetaLib.prototype.getDeprecatedMemberList=function(){if(this._deprecatedMembers){return this._deprecatedMembers}var json=this._json;var name,memName,memObj,o,a;var ret={};for(name in json){o=json[name];if(o&&o.member){for(memName in o.member){memObj=o.member[memName];if(memObj.ojdeprecated){if(ret[memName]){a=ret[memName]}else{ret[memName]=a=[]}a.push(name)}}}}return this._deprecatedMembers=ret};MetaLib.prototype.getDeletedMethodList=function(){if(this._deletedMethods){return this._deletedMethods}var json=this._delHist;var name,methName,ver,o,a;var ret={};if(json){for(name in json){o=json[name];if(o&&o.methods){for(methName in o.methods){ver=o.methods[methName];if(ret[methName]){a=ret[methName]}else{ret[methName]=a=[]}a.push(name);a.push(ver)}}}}return this._deletedMethods=ret};MetaLib.prototype.getDeletedMemberList=function(){if(this._deletedMembers){return this._deletedMembers}var json=this._delHist;var name,memName,ver,o,a;var ret={};if(json){for(name in json){o=json[name];if(o&&o.members){for(memName in o.members){ver=o.members[memName];if(ret[memName]){a=ret[memName]}else{ret[memName]=a=[]}a.push(name);a.push(ver)}}}}return this._deletedMembers=ret};MetaLib.prototype._getSlots=function(tagName){var obj=this._getComponentFromTag(_removeChevrons(tagName));return this._getSlots2(obj)};MetaLib.prototype._getSlots2=function(base){var bases,base,i,ret=null;while(base){ret=base&&base.slot?base.slot:null;if(ret){break}bases=base.header&&base.header.augments?base.header.augments:null;if(!bases){break}for(i=0;i<bases.length;i++){base=this._json[bases[i]];ret=this._getSlots2(base);if(ret){base=null;break}}}return ret?ret:null};MetaLib.prototype._getSlotByName=function(base,slotName){var ret=null;while(base){ret=base&&base.slot?base.slot:null;if(ret){ret=base.slot[slotName];if(ret){break}}break}return ret?ret:null};MetaLib.prototype._getComponentFromTag=function(tagName){var o=this._getComponentNameFromTag(tagName);if(o){o=this._json[o]}return o?o:null};function _getStyleIndices(scope,styleName){var a,n,ret,i;a=scope[styleName];if(a||a===0){if(!ret){ret=[]}if(Array.isArray(a)){for(i=0;i<a.length;i++){n=a[i];if(typeof n==="object"){n=a[i].index}ret.push(n)}}else{if(typeof a==="object"){n=a.index}else{n=a}ret.push(n)}}return ret&&ret.length?ret:null};MetaLib.prototype.getNonSSStyleElems=function(styleName,scope){var a,n,ret,i;scope=scope?this._json.ojStyles:this._json.genericStyles;a=scope[styleName];if(a||a===0){if(!ret){ret=[]}if(Array.isArray(a)){for(i=0;i<a.length;i++){n=a[i];if(typeof n==="object"&&!n.styleselector){n=a[i].index}ret.push(n)}}else{if(typeof a==="object"&&!a.styleselector){n=a.index}else{n=a}ret.push(n)}}return ret&&ret.length?_toContainers(scope,ret,this._json):null};MetaLib.prototype.displayImpls=function(){var impls,impl;this._console("[info] :--------- JET Interfaces Implemented ---------","I");if(!(impls=this._implements)){this._console(" None!","I")}else{for(impl in impls){this._console(`${impl} : <- <${impls[impl].join(",")}>`,"I")}}this._console("[info]: -------- End Declared Web Components ---------\n","I")};function _toContainers(scope,indices,json){var cont,ret,clazz,elem,n,i;cont=scope.containers;for(i=0;i<indices.length;i++){n=indices[i];if(n>=0){if(!ret){ret=[]}if(!json){ret[i]=cont[n]}else{clazz=cont[n];elem=json[clazz];if(elem&&elem.header){elem=elem.header.customelement;if(elem){ret[i]=elem}}}}}return ret&&ret.length?ret:null};function _convertValue(valType,value){var retValue=value;if(valType==="string"){retValue=value}else if(valType==="number"){retValue=Number(value)}else if(valType==="boolean"){retValue=value.toLowerCase()==="true"}return retValue};function _removeChevrons(tagName){if(tagName){let len=tagName.length-1;let start=tagName.charAt(0)==="<"?1:0;let end=tagName.charAt(len)===">"?len:++len;tagName=tagName.substring(start,end)}return tagName};module.exports=MetaLib;
|
package/lib/NetUtils.js
CHANGED
|
@@ -1 +1,6 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2018, 2022, Oracle and/or its affiliates.
|
|
3
|
+
* Licensed under The Universal Permissive License (UPL), Version 1.0
|
|
4
|
+
* as shown at https://oss.oracle.com/licenses/upl/
|
|
5
|
+
*/
|
|
1
6
|
const Url=require('url');var NetUtils=function(){this._request=require('sync-request')};NetUtils.prototype.loadUrl=function(url){var res,ret={};try{res=this._request('GET',url);ret.statusCode=res.statusCode;ret.headers=res.headers;if(res.statusCode===200){this._evalMediaType(res,ret)}}catch(e){ret.eCode=e.code;if(e.code=='ECONNREFUSED'&&url.startsWith('http://localhost:8136/rules')){ret.statusCode=4242}else{ret.statusCode=e.code==='ENOTFOUND'?404:999}}return ret};NetUtils.prototype.stripQuery=function(url){var u,path,x;u=Url.parse(url);path=u.pathname;x=url.indexOf(path);return url.substr(0,x+path.length)};NetUtils.prototype._evalMediaType=function(resp,ret){var contentType,body;contentType=resp.headers['content-type'];contentType=contentType?contentType.trim().toLowerCase():'text/plain';body=resp.getBody();if(contentType==='application/zip'||contentType==='application/7z'||contentType.startsWith('application/x-7z')||body[0]===80&&body[1]===75){ret.body=body;ret.type='zip'}else{if(contentType==='application/json'){ret.type='json'}else if(contentType.startsWith('application/javascript')||contentType.startsWith('text/javascript')){ret.type='js'}else if(contentType==='text/html'){ret.type='html'}else if(contentType==='text/css'){ret.type='css'}else if(contentType==='text/plain'){ret.type='text'}ret.body=body.toString('utf8')}};module.exports=NetUtils;
|
package/lib/NodeTypes.js
CHANGED
|
@@ -1 +1,6 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2018, 2022, Oracle and/or its affiliates.
|
|
3
|
+
* Licensed under The Universal Permissive License (UPL), Version 1.0
|
|
4
|
+
* as shown at https://oss.oracle.com/licenses/upl/
|
|
5
|
+
*/
|
|
1
6
|
const _nodetypes={TAG:"tag",DIRECTIVE:"directive",COMMENT:"comment",STYLE:"style",SCRIPT:"script",PRE:"pre",TEXT:"text"};module.exports=_nodetypes;
|
package/lib/Parser.js
CHANGED
|
@@ -1 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2018, 2022, Oracle and/or its affiliates.
|
|
3
|
+
* Licensed under The Universal Permissive License (UPL), Version 1.0
|
|
4
|
+
* as shown at https://oss.oracle.com/licenses/upl/
|
|
5
|
+
*/
|
|
6
|
+
const FILETYPE=require("./filetypes");const Json=require("./Json.js");const Ts=require("./Ts.js");const Md=require("./Md.js");function Parser(core,nodeDeps,rules,fileIndex,DomUtils,appCtx,msgCtx,constants){this.cssUtils=null;this.curFile=null;this.curFileType=null;this._fireHookFileRules=appCtx.fireHookFileRules;this.startCssPosition=0;this.startJsPosition=0;this.startIndex=0;this.endIndex=0;this.parseErrors=0;this._setConstants(constants);this._appCtx=appCtx;this._msgCtx=msgCtx;this._Json=new Json(this,nodeDeps,rules,fileIndex,appCtx,msgCtx);this._Ts=new Ts(this,nodeDeps,rules,fileIndex,appCtx,msgCtx);this._Md=new Md(this,nodeDeps,rules,fileIndex,appCtx,msgCtx)};Parser.prototype.clear=function(){this.startIndex=0;this.endIndex=0;this.startCssPosition={row:1,col:1,index:0};this._Json.clear();this._Ts.clear();this._Md.clear()};Parser.prototype.getAst=function(){var o;switch(this.curFileType){case FILETYPE.TS:o=this._Ts;break;case FILETYPE.JS:o=this._Js;break;case FILETYPE.JSON:o=this._Json;break;case FILETYPE.MD:o=this._Md;break;}return o?o.getAst():null};Parser.prototype.getAstUtils=function(){return FILETYPE.isFileTypeTsOrTsx(this.curFileType)?this._Ts.getAstUtils():this.curFileType==="js"?this.Js.getAstUtils():null};Parser.prototype.fireHookFileRules=function(node,obj,inScriptJs){return this._fireHookFileRules(node,obj,inScriptJs)};Parser.prototype.getParseErrors=function(){return this.parseErrors};Parser.prototype.parse=function(text,curFile,curFileType,arg1){var ret;switch(curFileType){case FILETYPE.TS:case FILETYPE.TSX:ret=this._parseTs(text,curFile,curFileType,arg1);break;case FILETYPE.JSON:ret=this._parseJson(text,curFile,curFileType);break;case FILETYPE.MD:ret=this._parseMd(text,curFile,curFileType);break;}return ret};Parser.prototype.parseOnly=function(text,curFile,curFileType){var ret;switch(curFileType){case FILETYPE.JSON:ret=this._parseJsonOnly(text,curFile,curFileType);break;default:this._msgCtx.assert("Unhandled Parser.parseOnly unexpected invocation");}return ret};Parser.prototype._parseHtml=function(text,curFile,curFileType,rawData,suppData){};Parser.prototype.getHtmlTopNode=function(){return this._Html.getTopNode()};Parser.prototype.getCurTagNode=function(){return this._Html.getCurTagNode()};Parser.prototype._parseCss=function(text){return this._Css.parse(text)};Parser.prototype._parseJs=function(text,curFile,curFileType,inner){if(typeof curFile!=="string"){var jj=42}if(curFile){this.curFile=curFile}if(curFileType){this.curFileType=curFileType}return this._Js.parse(text,inner)};Parser.prototype.getJsAst=function(){return this._Js.getJsAst()};Parser.prototype.getInScriptJs=function(){return this._Html.getInScriptJs()};Parser.prototype._parseTs=function(text,curFile,curFileType){if(curFile){this.curFile=curFile}if(curFileType){this.curFileType=curFileType}return this._Ts.parse(text,curFile,curFileType)};Parser.prototype._parseJson=function(text,curFile,curFileType){if(curFile){this.curFile=curFile}if(curFileType){this.curFileType=curFileType}return this._Json.parse(text,curFile,curFileType)};Parser.prototype._parseJsonOnly=function(text,curFile,curFileType){return this._Json.parseOnly(text,curFile,curFileType)};Parser.prototype._parseMd=function(text,curFile,curFileType){if(curFile){this.curFile=curFile}if(curFileType){this.curFileType=curFileType}return this._Md.parse(text,curFile,curFileType)};Parser.prototype.setCssUtils=function(utils){this.cssUtils=utils};Parser.prototype._setConstants=function(constants){for(let con in constants){this[con]=constants[con]}};module.exports=Parser;
|
package/lib/RegTypes.js
CHANGED
|
@@ -1 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2018, 2022, Oracle and/or its affiliates.
|
|
3
|
+
* Licensed under The Universal Permissive License (UPL), Version 1.0
|
|
4
|
+
* as shown at https://oss.oracle.com/licenses/upl/
|
|
5
|
+
*/
|
|
6
|
+
module.exports={ELEM:"elem",TAG:"tag",OJTAG:"ojtag",BINDING_TAG:"bindingtag",WEBCOMP:"webcomp",GLOBTAG:"globtag",ATTR:"attr",ATTREXPR:"attrexpr",CLASS:"class",EVENT:"event",COMMENT:"comment",PROCSTMT:"procstmt",DIRECTIVE:"directive",DOCTYPE:"doctype",PHASE_FILE:"file",PHASE_STARTUP:"startup",PHASE_CLOSEDOWN:"closedown",PHASE_STARTUP_RULEPACK:"startupRP",PHASE_CLOSEDOWN_RULEPACK:"closedownRP",PHASE_START_AUDIT:"startaudit",PHASE_END_AUDIT:"endaudit"};
|
package/lib/Registry.js
CHANGED
|
@@ -1 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2018, 2022, Oracle and/or its affiliates.
|
|
3
|
+
* Licensed under The Universal Permissive License (UPL), Version 1.0
|
|
4
|
+
* as shown at https://oss.oracle.com/licenses/upl/
|
|
5
|
+
*/
|
|
6
|
+
const RULE_RE=new RegExp(/[~`!#$%\^&*+\[\]\\';,/{}|\\"\?]/);var Registry=function(appCtx){this._registry={};this._regexps={};this._reObjs={};this._appCtx=appCtx;this._info=appCtx.info;this._assert=appCtx.assert};Registry.prototype.getRegisteredCallbacks=function(type){var reo,ret;ret=this._registry[type];if(!type.startsWith("css-")&&type.indexOf("-")>0&&type.indexOf("|")<0){ret={...ret};type=type.substring(1,type.length-1).trim();for(re in this._regexps){reo=this._reObjs[re];if(reo&&reo.test(type)){if(!ret){ret={}}for(x in this._regexps[re]){ret[x]=this._regexps[re][x]}}};}return ret};Registry.prototype.isRegisteredCallback=function(type){return!!this._registry[type]};Registry.prototype.isRegisteredCallbackRE=function(elem){var ret,i;if(ret=this.isRegisteredCallback(elem)){return ret}elem=elem.startsWith("<")?elem.substring(1,elem.length-1):elem;for(re in this._regexps){if(this._reObjs[re].test(elem)){return true}}return false};Registry.prototype.setRuleCallback=function(ruleName,ruleRegs,rsi){var typeObj,regType,rt,callbacks,func,args,elem;for(regType in ruleRegs){func=ruleRegs[regType];if(typeof func!=="function"){this._info(`Rule ${ruleName} : registered '${regType}' is not a function`);continue}rt=elem=regType;if(regType.charAt(0)==="<"){rt=regType.substring(1,regType.length-1).trim();args=rt.split(" ");if(args.length>1){attrib=args[args.length-1];if(attrib.endsWith("=")){rt=args[0]+"|"+attrib.substring(0,attrib.length-1)}elem=args[0]}else{elem=rt.endsWith("=")?null:rt}regType=`<${rt}>`}if(!elem||!_isRE(elem)){if(!(typeObj=this._registry[regType])){this._registry[regType]=typeObj={}}}else{if(!(typeObj=this._regexps[rt])){this._regexps[rt]=typeObj={}}if(!this._reObjs[rt]){this._reObjs[rt]=new RegExp(rt)}}if(!(callbacks=typeObj[ruleName])){typeObj[ruleName]=callbacks=[]}callbacks.push({cb:func,rsi:rsi})}};Registry.prototype.XXsetRuleCallback=function(ruleName,ruleRegs,rsi){var typeObj,callbackType,ruleCallbacks,func;if(Array.isArray(ruleRegs)){var jj=this._setRuleCallback2(ruleName,ruleRegs)}else if(typeof ruleRegs!=="object"){return}else if(ruleRegs.cb){let regs=this._setExtended(ruleName,ruleRegs,rsi);if(regs){ruleRegs=regs}}for(callbackType in ruleRegs){func=ruleRegs[callbackType];if(typeof func!=="function"){this._info("Rule "+ruleName+" : registered '"+callbackType+"' is not a function");continue}typeObj=this._registry[callbackType];if(!typeObj){this._registry[callbackType]=typeObj={}}ruleCallbacks=typeObj[ruleName];if(!ruleCallbacks){typeObj[ruleName]=ruleCallbacks=[]}ruleCallbacks.push({cb:func,rsi:rsi})}};Registry.prototype.XXsetRuleCallback2=function(ruleName,regs,rsi){var a,i,j,props,prop,reg,val;for(i=0;i<regs.length;i++){reg=regs[i];if(!reg.cb){if(!a){a=[]}a.push(reg);continue}props=Object.keys(reg);if(props.length===2){for(j=0;j<props.length;j++){prop=props[j];if(prop!=="cb"){val=reg[prop];if(typeof val==="boolean"&&val){a.push({prop:val});break}}}continue}}};Registry.prototype.dump=function(){var type,rule,vals,tagWidth,tagLen=0,indent,isFirst,s="";var list2={},ruleWidth,ruleLen=0,source,i;for(type in this._registry){if(type.length>tagLen){tagLen=type.length}}for(type in this._regexps){if(type.length>tagLen){tagLen=type.length}}tagWidth=tagLen+3;indent=" ".repeat(tagWidth);s="\n"+ljustify("--- Tags ---",indent.length,indent)+"----- rules -----";source=this._registry;for(i=0;i<2;i++){for(type in source){s+="\n"+ljustify(type,tagWidth,indent);vals=source[type];isFirst=true;for(rule in vals){s+=(isFirst?"":indent)+rule+"\n";isFirst=false;if(!list2[rule]){list2[rule]=[]}list2[rule].push(type);if(rule.length>ruleLen){ruleLen=rule.length}}}source=this._regexps}ruleWidth=ruleLen+2;indent=" ".repeat(ruleWidth);s+="\n"+ljustify("----- Rules -----",indent.length,indent)+"--- Tags ---";for(rule in list2){vals=list2[rule];s+="\n"+ljustify(rule,ruleWidth,indent);isFirst=true;for(i=0;i<vals.length;i++){s+=(isFirst?"":indent)+vals[i]+"\n";isFirst=false}}return s+"\n"};function ljustify(n,w,blanks){var s=n.toString();var l=s.length;return s+blanks.substr(0,w-l)};function _isRE(s){return RULE_RE.test(s)};module.exports=Registry;
|