How to use xfc - 10 common examples

To help you get started, we’ve selected a few xfc 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 cerner / terra-core / packages / terra-site / src / examples / embedded-content-consumer / Index.jsx View on Github external
// Example files
import BasicConsumer from './consumers/BasicConsumer';
import BasicConsumerSrc from '!raw-loader!./consumers/BasicConsumer';
import CustomEventConsumer from './consumers/CustomEventConsumer';
import CustomEventConsumerSrc from '!raw-loader!./consumers/CustomEventConsumer';
import CustomEventsConsumer from './consumers/CustomEventsConsumer';
import CustomEventsConsumerSrc from '!raw-loader!./consumers/CustomEventsConsumer';
import DataStatusConsumer from './consumers/DataStatusConsumer';
import DataStatusConsumerSrc from '!raw-loader!./consumers/DataStatusConsumer';
import FillConsumer from './consumers/FillConsumer';
import FillConsumerSrc from '!raw-loader!./consumers/FillConsumer';
import OnReadyConsumer from './consumers/OnReadyConsumer';
import OnReadyConsumerSrc from '!raw-loader!./consumers/OnReadyConsumer';

Consumer.init();

const DocPage = () => (
  ,
        source: BasicConsumerSrc,
      },
      {
        title: 'Filled Embedded Content',
        example: ,
        source: FillConsumerSrc,
github cerner / terra-core / packages / terra-embedded-content-consumer / src / terra-dev-site / doc / embedded-content-consumer / EmbeddedContentConsumer.1.doc.jsx View on Github external
// Example files
import BasicConsumer from '../example/BasicConsumer';
import BasicConsumerSrc from '!raw-loader!../../../../src/terra-dev-site/doc/example/BasicConsumer';
import CustomEventConsumer from '../example/CustomEventConsumer';
import CustomEventConsumerSrc from '!raw-loader!../../../../src/terra-dev-site/doc/example/CustomEventConsumer';
import CustomEventsConsumer from '../example/CustomEventsConsumer';
import CustomEventsConsumerSrc from '!raw-loader!../../../../src/terra-dev-site/doc/example/CustomEventsConsumer';
import DataStatusConsumer from '../example/DataStatusConsumer';
import DataStatusConsumerSrc from '!raw-loader!../../../../src/terra-dev-site/doc/example/DataStatusConsumer';
import FillConsumer from '../example/FillConsumer';
import FillConsumerSrc from '!raw-loader!../../../../src/terra-dev-site/doc/example/FillConsumer';
import OnReadyConsumer from '../example/OnReadyConsumer';
import OnReadyConsumerSrc from '!raw-loader!../../../../src/terra-dev-site/doc/example/OnReadyConsumer';
/* eslint-enable import/no-webpack-loader-syntax, import/first, import/extensions, import/no-unresolved, import/no-duplicates */

Consumer.init();

const DocPage = () => (
  ,
        source: BasicConsumerSrc,
      },
      {
        title: 'Filled Embedded Content',
        example: ,
        source: FillConsumerSrc,
github cerner / terra-framework / packages / terra-embedded-content-consumer / src / terra-dev-site / doc / embedded-content-consumer / EmbeddedContentConsumer.1.doc.jsx View on Github external
import { name } from '../../../../package.json';

// Component Source
import EmbeddedContentConsumerSrc from '!raw-loader!../../../../src/EmbeddedContentConsumer.jsx';

// Example files
import BasicConsumer from '../example/BasicConsumer';
import BasicConsumerSrc from '!raw-loader!../../../../src/terra-dev-site/doc/example/BasicConsumer';
import CustomEventConsumer from '../example/CustomEventConsumer';
import CustomEventConsumerSrc from '!raw-loader!../../../../src/terra-dev-site/doc/example/CustomEventConsumer';
import CustomEventsConsumer from '../example/CustomEventsConsumer';
import CustomEventsConsumerSrc from '!raw-loader!../../../../src/terra-dev-site/doc/example/CustomEventsConsumer';
import DataStatusConsumer from '../example/DataStatusConsumer';
import DataStatusConsumerSrc from '!raw-loader!../../../../src/terra-dev-site/doc/example/DataStatusConsumer';

Consumer.init();

const DocPage = () => (
  ,
        source: BasicConsumerSrc,
      },
      {
        title: 'Embedded Content Consumer Lifecycle Statuses',
        example: ,
        source: DataStatusConsumerSrc,
github cerner / terra-core / packages / terra-embedded-content-consumer / src / EmbeddedContentConsumer.jsx View on Github external
componentDidMount() {
    // Mount the provided source as the application into the content wrapper.
    this.xfcFrame = Consumer.mount(this.embeddedContentWrapper, this.props.src, this.props.options);

    // Notify that the consumer frame has mounted.
    if (this.props.onMount) {
      this.props.onMount(this.xfcFrame);
    }

    // Attach the event handlers to the xfc frame.
    this.addEventListener('xfc.launched', this.props.onLaunch);
    this.addEventListener('xfc.authorized', this.props.onAuthorize);

    // Attach custom event handlers to the xfc frame.
    this.addEventListeners(this.props.eventHandlers);
  }
github cerner / terra-core / packages / terra-site / src / examples / embedded-content-consumer / consumers / DataStatusConsumer.jsx View on Github external
import React from 'react';
import { Consumer } from 'xfc';
import EmbeddedContentConsumer from 'terra-embedded-content-consumer';

Consumer.init();

const createListItem = (itemName) => {
  const listItem = document.createElement('li');
  listItem.setAttribute('id', itemName);
  listItem.appendChild(document.createTextNode(itemName));

  return listItem;
};

const appendLifeCycleStatuses = (statuses) => {
  const frames = document.getElementsByTagName('iframe');
  for (let frameIndex = 0; frameIndex < frames.length; frameIndex += 1) {
    const frame = frames[frameIndex];
    const statusList = frame.contentWindow.document.getElementById('DataStatus-LifeCycleStatuses');
    if (statusList) {
      statuses.forEach((status) => { statusList.appendChild(createListItem(status)); });
github cerner / cerner-smart-embeddable-lib / src / js / cerner-smart-embeddable-lib.js View on Github external
init: () => {
    Provider.init({
      acls: ['https://embedded.cerner.com',
        'https://embedded.sandboxcerner.com', 'https://embedded.devcerner.com'],
    });
  },
  /**
github cerner / terra-framework / packages / terra-embedded-content-consumer / src / terra-dev-site / provider / embedded-content-consumer / providers / CustomEventsProvider.provider.jsx View on Github external
addEventListener(eventName) {
    Provider.on(eventName, (event) => {
      document.getElementById('embedded-content-consumer-reply').innerHTML = `embedded-content-consumer reply: ${JSON.stringify(event)}`;
    });
  }

xfc

A Cross Frame Container that handles securely embedding web content into a 3rd party domain

Apache-2.0
Latest version published 1 year ago

Package Health Score

58 / 100
Full package analysis