当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript Chain.mapper方法代码示例

本文整理汇总了TypeScript中@ephox/agar.Chain.mapper方法的典型用法代码示例。如果您正苦于以下问题:TypeScript Chain.mapper方法的具体用法?TypeScript Chain.mapper怎么用?TypeScript Chain.mapper使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在@ephox/agar.Chain的用法示例。


在下文中一共展示了Chain.mapper方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: function

  const sTestBookmark = function (html, path) {
    const dom = DOMUtils.DOM;
    const elm = TinyDom.fromDom(dom.create('div', {}, html));

    return Chain.asStep(elm, [
      Cursors.cFollowPath(Cursors.pathFrom(path)),
      Chain.mapper(toNativeRange),
      Chain.mapper(rangeToBookmark(dom)),
      Chain.mapper(bookmarkToRange(dom)),
      cAssertRangeEq(Cursors.calculate(elm, Cursors.pathFrom(path)))
    ]);
  };
开发者ID:danielpunkass,项目名称:tinymce,代码行数:12,代码来源:BookmarkTest.ts

示例2: getClosestCellBelow

 const cGetClosestCellBelow = (x: number, y: number) => {
   return Chain.mapper(function (viewBlock) {
     const table = SelectorFind.descendant(Element.fromDom(viewBlock.get()), 'table').getOrDie('Could not find table').dom();
     const rect = table.getBoundingClientRect();
     return getClosestCellBelow(table, rect.left + x, rect.top + y);
   });
 };
开发者ID:abstask,项目名称:tinymce,代码行数:7,代码来源:TableCellsTest.ts

示例3:

const sAssertValue = (label, expected, component) => Logger.t(
  'sAssertValue: ' + label,
  Chain.asStep(component, [
    Chain.mapper(Representing.getValue),
    Assertions.cAssertEq(label, expected)
  ])
);
开发者ID:tinymce,项目名称:tinymce,代码行数:7,代码来源:ReperesentingSteps.ts

示例4: function

 const cMergeBlocks = function (forward, block1Path, block2Path) {
   return Chain.mapper(function (viewBlock: any) {
     const block1 = Hierarchy.follow(Element.fromDom(viewBlock.get()), block1Path).getOrDie();
     const block2 = Hierarchy.follow(Element.fromDom(viewBlock.get()), block2Path).getOrDie();
     return MergeBlocks.mergeBlocks(Element.fromDom(viewBlock.get()), forward, block1, block2);
   });
 };
开发者ID:danielpunkass,项目名称:tinymce,代码行数:7,代码来源:MergeBlocksTest.ts

示例5: function

 const sAssertErrorMessage = function (html) {
   return Step.label('Check notification message', Chain.asStep(TinyDom.fromDom(document.body), [
     UiFinder.cWaitFor('Find notification', '.tox-notification__body > p'),
     Chain.label('Get notification HTML', Chain.mapper(Html.get)),
     Chain.label('Assert HTML matches expected', Assertions.cAssertHtml('Message html does not match', html))
   ]));
 };
开发者ID:tinymce,项目名称:tinymce,代码行数:7,代码来源:ImageToolsErrorTest.ts

示例6: TinyApis

    TinyLoader.setup(function (editor, onSuccess, onFailure) {
      const tinyApis = TinyApis(editor);
      const tinyUi = TinyUi(editor);

      Pipeline.async({}, [
          tinyApis.sFocus,
          tinyUi.sClickOnToolbar('click emoticons', 'button'),
          Chain.asStep({}, [
            tinyUi.cWaitForPopup('wait for popup', 'div[role="dialog"]'),
          ]),
          Waiter.sTryUntil(
            'Wait for emojis to load',
            UiFinder.sNotExists(Body.body(), '.tox-spinner'),
            100,
            1000
          ),
          Chain.asStep(Body.body(), [
            UiFinder.cFindAllIn('[role="tab"]'),
            Chain.mapper((elements: Element[]) => {
              return Arr.map(elements, (elm: Element) => {
                return elm.dom().textContent;
              });
            }),
            Assertions.cAssertEq('Categories match', categories)
          ])
        ], onSuccess, onFailure);
    }, {
开发者ID:tinymce,项目名称:tinymce,代码行数:27,代码来源:DifferentEmojiDatabaseTest.ts

示例7: function

 const sWaitForAndAssertNotification = function (expected) {
   return Chain.asStep(TinyDom.fromDom(document.body), [
     UiFinder.cWaitFor('Could not find notification', 'div.mce-notification-inner'),
     Chain.mapper(Html.get),
     Assertions.cAssertHtml('Plugin list html does not match', expected)
   ]);
 };
开发者ID:danielpunkass,项目名称:tinymce,代码行数:7,代码来源:IsCachedResponseTest.ts

示例8: findClosestHorizontalPosition

 const cFindClosestHorizontalPosition = (path: number[], offset: number) => {
   return Chain.mapper(function (positions: CaretPosition[]) {
     const container = Hierarchy.follow(Element.fromDom(viewBlock.get()), path).getOrDie();
     const pos = CaretPosition(container.dom(), offset);
     return findClosestHorizontalPosition(positions, pos);
   });
 };
开发者ID:tinymce,项目名称:tinymce,代码行数:7,代码来源:LineReaderTest.ts

示例9: getPositionsBelow

 const cGetBelowPositions = (path: number[], offset: number) => {
   return Chain.mapper(function (scope: any) {
     const container = Hierarchy.follow(Element.fromDom(scope.get()), path).getOrDie();
     const pos = CaretPosition(container.dom(), offset);
     return getPositionsBelow(scope.get(), pos);
   });
 };
开发者ID:tinymce,项目名称:tinymce,代码行数:7,代码来源:LineReaderTest.ts

示例10: predicate

 const cVisualCaretCheck = (predicate, path: number[], offset: number) => {
   return Chain.mapper(function (scope: any) {
     const container = Hierarchy.follow(Element.fromDom(scope.get()), path).getOrDie();
     const pos = CaretPosition(container.dom(), offset);
     return predicate(scope.get(), pos);
   });
 };
开发者ID:tinymce,项目名称:tinymce,代码行数:7,代码来源:LineReaderTest.ts


注:本文中的@ephox/agar.Chain.mapper方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。