How to use the @ephox/boulder.ValueSchema.asRawOrDie function in @ephox/boulder

To help you get started, we’ve selected a few @ephox/boulder examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github tinymce / tinymce / modules / tinymce / src / themes / mobile / main / ts / ui / SerialisedDialog.ts View on Github external
const schema = ValueSchema.objOf([
    FieldSchema.strict('fields'),
    // Used for when datafields are present.
    FieldSchema.defaulted('maxFieldIndex', rawSpec.fields.length - 1),
    FieldSchema.strict('onExecute'),
    FieldSchema.strict('getInitialValue'),
    FieldSchema.state('state', function () {
      return {
        dialogSwipeState: Singleton.value(),
        currentScreen: Cell(0)
      };
    })
  ]);

  const spec = ValueSchema.asRawOrDie('SerialisedDialog', schema, rawSpec);

  const navigationButton = function (direction, directionName, enabled) {
    return Button.sketch({
      dom: UiDomFactory.dom('<span class="${prefix}-icon-' + directionName + ' ${prefix}-icon"></span>'),
      action (button) {
        AlloyTriggers.emitWith(button, navigateEvent, { direction });
      },
      buttonBehaviours: Behaviour.derive([
        Disabling.config({
          disableClass: Styles.resolve('toolbar-navigation-disabled'),
          disabled: !enabled
        })
      ])
    });
  };
github tinymce / tinymce / modules / tinymce / src / themes / silver / demo / ts / components / DialogComponentsDemo.ts View on Github external
memCollection.getOpt(everything).each((collection) => {
    Representing.setValue(collection,
      ValueSchema.asRawOrDie('dialogComponentsDemo.collection', Types.Collection.collectionDataProcessor, [
        {
          value: 'a',
          text: 'A',
          icon: 'a'
        },
        {
          value: 'b',
          text: 'B',
          icon: 'b'
        },
        {
          value: 'c',
          text: 'C',
          icon: 'c'
        },
        {
github tinymce / tinymce / modules / alloy / src / main / ts / ephox / alloy / api / behaviour / Behaviour.ts View on Github external
const createModes = (data: BehaviourModeSpec): AlloyBehaviour =&gt; {
  const value: BehaviourModeSpec = ValueSchema.asRawOrDie('Creating behaviour: ' + data.name, modeSchema, data);
  return CommonBehaviour.createModes(
    ValueSchema.choose(value.branchKey, value.branches),
    value.name, value.active, value.apis, value.extra, value.state
  );
};
github tinymce / tinymce / modules / alloy / src / main / ts / ephox / alloy / api / behaviour / Behaviour.ts View on Github external
const create = (data: AlloyBehaviourConfig): AlloyBehaviour =&gt; {
  const value = ValueSchema.asRawOrDie('Creating behaviour: ' + data.name, simpleSchema, data);
  return CommonBehaviour.create(value.fields, value.name, value.active, value.apis, value.extra, value.state);
};