/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ /** * This is an R3 `Node`-like wrapper for a raw `html.Comment` node. We do not currently * require the implementation of a visitor for Comments as they are only collected at * the top-level of the R3 AST, and only if `Render3ParseOptions['collectCommentNodes']` * is true. */ export class Comment { constructor(value, sourceSpan) { this.value = value; this.sourceSpan = sourceSpan; } visit(_visitor) { throw new Error('visit() not implemented for Comment'); } } export class Text { constructor(value, sourceSpan) { this.value = value; this.sourceSpan = sourceSpan; } visit(visitor) { return visitor.visitText(this); } } export class BoundText { constructor(value, sourceSpan, i18n) { this.value = value; this.sourceSpan = sourceSpan; this.i18n = i18n; } visit(visitor) { return visitor.visitBoundText(this); } } /** * Represents a text attribute in the template. * * `valueSpan` may not be present in cases where there is no value `
`. * `keySpan` may also not be present for synthetic attributes from ICU expansions. */ export class TextAttribute { constructor(name, value, sourceSpan, keySpan, valueSpan, i18n) { this.name = name; this.value = value; this.sourceSpan = sourceSpan; this.keySpan = keySpan; this.valueSpan = valueSpan; this.i18n = i18n; } visit(visitor) { return visitor.visitTextAttribute(this); } } export class BoundAttribute { constructor(name, type, securityContext, value, unit, sourceSpan, keySpan, valueSpan, i18n) { this.name = name; this.type = type; this.securityContext = securityContext; this.value = value; this.unit = unit; this.sourceSpan = sourceSpan; this.keySpan = keySpan; this.valueSpan = valueSpan; this.i18n = i18n; } static fromBoundElementProperty(prop, i18n) { if (prop.keySpan === undefined) { throw new Error(`Unexpected state: keySpan must be defined for bound attributes but was not for ${prop.name}: ${prop.sourceSpan}`); } return new BoundAttribute(prop.name, prop.type, prop.securityContext, prop.value, prop.unit, prop.sourceSpan, prop.keySpan, prop.valueSpan, i18n); } visit(visitor) { return visitor.visitBoundAttribute(this); } } export class BoundEvent { constructor(name, type, handler, target, phase, sourceSpan, handlerSpan, keySpan) { this.name = name; this.type = type; this.handler = handler; this.target = target; this.phase = phase; this.sourceSpan = sourceSpan; this.handlerSpan = handlerSpan; this.keySpan = keySpan; } static fromParsedEvent(event) { const target = event.type === 0 /* ParsedEventType.Regular */ ? event.targetOrPhase : null; const phase = event.type === 1 /* ParsedEventType.Animation */ ? event.targetOrPhase : null; if (event.keySpan === undefined) { throw new Error(`Unexpected state: keySpan must be defined for bound event but was not for ${event.name}: ${event.sourceSpan}`); } return new BoundEvent(event.name, event.type, event.handler, target, phase, event.sourceSpan, event.handlerSpan, event.keySpan); } visit(visitor) { return visitor.visitBoundEvent(this); } } export class Element { constructor(name, attributes, inputs, outputs, children, references, sourceSpan, startSourceSpan, endSourceSpan, i18n) { this.name = name; this.attributes = attributes; this.inputs = inputs; this.outputs = outputs; this.children = children; this.references = references; this.sourceSpan = sourceSpan; this.startSourceSpan = startSourceSpan; this.endSourceSpan = endSourceSpan; this.i18n = i18n; } visit(visitor) { return visitor.visitElement(this); } } export class DeferredTrigger { constructor(sourceSpan) { this.sourceSpan = sourceSpan; } visit(visitor) { return visitor.visitDeferredTrigger(this); } } export class BoundDeferredTrigger extends DeferredTrigger { constructor(value, sourceSpan) { super(sourceSpan); this.value = value; } } export class IdleDeferredTrigger extends DeferredTrigger { } export class ImmediateDeferredTrigger extends DeferredTrigger { } export class HoverDeferredTrigger extends DeferredTrigger { } export class TimerDeferredTrigger extends DeferredTrigger { constructor(delay, sourceSpan) { super(sourceSpan); this.delay = delay; } } export class InteractionDeferredTrigger extends DeferredTrigger { constructor(reference, sourceSpan) { super(sourceSpan); this.reference = reference; } } export class ViewportDeferredTrigger extends DeferredTrigger { constructor(reference, sourceSpan) { super(sourceSpan); this.reference = reference; } } export class DeferredBlockPlaceholder { constructor(children, minimumTime, sourceSpan, startSourceSpan, endSourceSpan) { this.children = children; this.minimumTime = minimumTime; this.sourceSpan = sourceSpan; this.startSourceSpan = startSourceSpan; this.endSourceSpan = endSourceSpan; } visit(visitor) { return visitor.visitDeferredBlockPlaceholder(this); } } export class DeferredBlockLoading { constructor(children, afterTime, minimumTime, sourceSpan, startSourceSpan, endSourceSpan) { this.children = children; this.afterTime = afterTime; this.minimumTime = minimumTime; this.sourceSpan = sourceSpan; this.startSourceSpan = startSourceSpan; this.endSourceSpan = endSourceSpan; } visit(visitor) { return visitor.visitDeferredBlockLoading(this); } } export class DeferredBlockError { constructor(children, sourceSpan, startSourceSpan, endSourceSpan) { this.children = children; this.sourceSpan = sourceSpan; this.startSourceSpan = startSourceSpan; this.endSourceSpan = endSourceSpan; } visit(visitor) { return visitor.visitDeferredBlockError(this); } } export class DeferredBlock { constructor(children, triggers, prefetchTriggers, placeholder, loading, error, sourceSpan, startSourceSpan, endSourceSpan) { this.children = children; this.triggers = triggers; this.prefetchTriggers = prefetchTriggers; this.placeholder = placeholder; this.loading = loading; this.error = error; this.sourceSpan = sourceSpan; this.startSourceSpan = startSourceSpan; this.endSourceSpan = endSourceSpan; } visit(visitor) { return visitor.visitDeferredBlock(this); } } export class Template { constructor( // tagName is the name of the container element, if applicable. // `null` is a special case for when there is a structural directive on an `ng-template` so // the renderer can differentiate between the synthetic template and the one written in the // file. tagName, attributes, inputs, outputs, templateAttrs, children, references, variables, sourceSpan, startSourceSpan, endSourceSpan, i18n) { this.tagName = tagName; this.attributes = attributes; this.inputs = inputs; this.outputs = outputs; this.templateAttrs = templateAttrs; this.children = children; this.references = references; this.variables = variables; this.sourceSpan = sourceSpan; this.startSourceSpan = startSourceSpan; this.endSourceSpan = endSourceSpan; this.i18n = i18n; } visit(visitor) { return visitor.visitTemplate(this); } } export class Content { constructor(selector, attributes, sourceSpan, i18n) { this.selector = selector; this.attributes = attributes; this.sourceSpan = sourceSpan; this.i18n = i18n; this.name = 'ng-content'; } visit(visitor) { return visitor.visitContent(this); } } export class Variable { constructor(name, value, sourceSpan, keySpan, valueSpan) { this.name = name; this.value = value; this.sourceSpan = sourceSpan; this.keySpan = keySpan; this.valueSpan = valueSpan; } visit(visitor) { return visitor.visitVariable(this); } } export class Reference { constructor(name, value, sourceSpan, keySpan, valueSpan) { this.name = name; this.value = value; this.sourceSpan = sourceSpan; this.keySpan = keySpan; this.valueSpan = valueSpan; } visit(visitor) { return visitor.visitReference(this); } } export class Icu { constructor(vars, placeholders, sourceSpan, i18n) { this.vars = vars; this.placeholders = placeholders; this.sourceSpan = sourceSpan; this.i18n = i18n; } visit(visitor) { return visitor.visitIcu(this); } } export class RecursiveVisitor { visitElement(element) { visitAll(this, element.attributes); visitAll(this, element.inputs); visitAll(this, element.outputs); visitAll(this, element.children); visitAll(this, element.references); } visitTemplate(template) { visitAll(this, template.attributes); visitAll(this, template.inputs); visitAll(this, template.outputs); visitAll(this, template.children); visitAll(this, template.references); visitAll(this, template.variables); } visitDeferredBlock(deferred) { visitAll(this, deferred.triggers); visitAll(this, deferred.prefetchTriggers); visitAll(this, deferred.children); deferred.placeholder?.visit(this); deferred.loading?.visit(this); deferred.error?.visit(this); } visitDeferredBlockPlaceholder(block) { visitAll(this, block.children); } visitDeferredBlockError(block) { visitAll(this, block.children); } visitDeferredBlockLoading(block) { visitAll(this, block.children); } visitContent(content) { } visitVariable(variable) { } visitReference(reference) { } visitTextAttribute(attribute) { } visitBoundAttribute(attribute) { } visitBoundEvent(attribute) { } visitText(text) { } visitBoundText(text) { } visitIcu(icu) { } visitDeferredTrigger(trigger) { } } export function visitAll(visitor, nodes) { const result = []; if (visitor.visit) { for (const node of nodes) { visitor.visit(node) || node.visit(visitor); } } else { for (const node of nodes) { const newNode = node.visit(visitor); if (newNode) { result.push(newNode); } } } return result; } //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicjNfYXN0LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vLi4vcGFja2FnZXMvY29tcGlsZXIvc3JjL3JlbmRlcjMvcjNfYXN0LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOzs7Ozs7R0FNRztBQVlIOzs7OztHQUtHO0FBQ0gsTUFBTSxPQUFPLE9BQU87SUFDbE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