Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
lazySink().each((sink) => f(sink.element()));
};
const onDockingSwitch = (comp: AlloyComponent) => {
if (!editor.inline) {
updateIframeContentFlow(comp);
}
updateEditorClasses(editor, Docking.isDocked(comp));
comp.getSystem().broadcastOn( [ Channels.repositionPopups() ], { });
lazySink().each((sink) => sink.getSystem().broadcastOn( [ Channels.repositionPopups() ], { }));
};
const additionalBehaviours = editor.inline ? [ ] : getIframeBehaviours();
return [
Focusing.config({ }),
Docking.config({
leftAttr: 'data-dock-left',
topAttr: 'data-dock-top',
positionAttr: 'data-dock-pos',
contextual: {
lazyContext (comp) {
const headerHeight = Height.getOuter(comp.element());
const container = editor.inline ? editor.getContentAreaContainer() : editor.getContainer();
const box = Boxes.box(Element.fromDom(container));
// Force the header to hide before it overflows outside the container
const boxHeight = box.height() - headerHeight;
return Option.some(Boxes.bounds(box.x(), box.y(), box.width(), boxHeight));
},
onShow: () => {
runOnSinkElement((elem) => updateSinkVisibility(elem, true));
},const factory = (newSpec: { uid: string }) => {
return NavigableObject.craft(
{
// We need to use the part uid or the label and field won't be linked with ARIA
uid: newSpec.uid,
dom: {
tag: 'iframe',
attributes
},
behaviours: Behaviour.derive([
Tabstopping.config({ }),
Focusing.config({ }),
RepresentingConfigs.withComp(Option.none(), sourcing.getValue, sourcing.setValue)
])
}
);
};role: 'presentation'
}
},
model: {
mode: 'x',
minX: min,
maxX: max,
getInitialValue: Fun.constant({ x: Fun.constant(value) })
},
components: [
labelPart,
spectrum,
thumb
],
sliderBehaviours: Behaviour.derive([
Focusing.config({})
]),
onChoose
}));
};innerHtml: spec.html
}
});
} else {
return AlloyContainer.sketch({
dom: {
tag: 'div',
classes: [ 'tox-form__group' ],
innerHtml: spec.html,
attributes: {
role: 'document'
}
},
containerBehaviours: Behaviour.derive([
Tabstopping.config({ }),
Focusing.config({ })
])
});
}
};const pField = AlloyFormField.parts().field({
factory: { sketch: Fun.identity },
dom: {
tag: 'input',
classes: ['tox-checkbox__input'],
attributes: {
type: 'checkbox'
}
},
behaviours: Behaviour.derive([
ComposingConfigs.self(),
Disabling.config({ disabled: spec.disabled }),
Tabstopping.config({}),
Focusing.config({ }),
repBehaviour,
Keying.config({
mode: 'special',
onEnter: toggleCheckboxHandler,
onSpace: toggleCheckboxHandler,
stopSpaceKeyup: true
}),
AddEventsBehaviour.config('checkbox-events', [
AlloyEvents.run(NativeEvents.change(), (component, _) => {
AlloyTriggers.emitWith(component, formChangeEvent, { name: spec.name } );
})
])
]),
});
const pLabel = AlloyFormField.parts().label({});
const renderTd = (text: string) => ({ dom: { tag: 'td', innerHtml: providersBackstage.translate(text) } });
const renderTr = (row: string[]) => ({ dom: { tag: 'tr' }, components: Arr.map(row, renderTd) });
const renderRows = (rows: string[][]) => ({ dom: { tag: 'tbody' }, components: Arr.map(rows, renderTr) });
return {
dom: {
tag: 'table',
classes: [ 'tox-dialog__table' ]
},
components: [
renderHeader(spec.header),
renderRows(spec.cells)
],
behaviours: Behaviour.derive([
Tabstopping.config({ }),
Focusing.config({ })
])
};
};