Yuki Takei 3 лет назад
Родитель
Сommit
36f4c7c061

+ 1 - 2
packages/presentation/package.json

@@ -29,7 +29,6 @@
     "react": "^18.2.0",
     "react": "^18.2.0",
     "react-dom": "^18.2.0",
     "react-dom": "^18.2.0",
     "react-markdown": "^8.0.3",
     "react-markdown": "^8.0.3",
-    "reveal.js": "^4.4.0",
-    "spectacle": "^9.6.0"
+    "reveal.js": "^4.4.0"
   }
   }
 }
 }

+ 0 - 0
packages/presentation/src/components/PresentationWithReveal.tsx → packages/presentation/src/components/Presentation.tsx


+ 0 - 47
packages/presentation/src/components/PresentationWithSpectacle.tsx

@@ -1,47 +0,0 @@
-import React from 'react';
-
-import {
-  Deck, Slide, FlexBox, Box, FullScreen, Progress, MarkdownSlideSet,
-} from 'spectacle';
-
-type Props = {
-  children?: string,
-}
-
-const theme = {
-  colors: {
-    tertiary: 'var(--bgcolor-global)',
-    primary: 'var(--primary)',
-    secondary: 'var(--secondary)',
-  },
-};
-
-const template = ({ slideNumber, numberOfSlides }) => (
-  <FlexBox
-    justifyContent="space-between"
-    position="absolute"
-    bottom={0}
-    width={1}
-  >
-    <Box padding="0 1em">
-      <FullScreen />
-    </Box>
-    <Box padding="1em">
-      <Progress />
-      {slideNumber} / {numberOfSlides}
-    </Box>
-  </FlexBox>
-);
-
-export const Presentation = (props: Props): JSX.Element => {
-  const { children } = props;
-
-  return (
-    <Deck theme={theme} template={template}>
-      { children == null
-        ? <Slide>No contents</Slide>
-        : <MarkdownSlideSet>{children}</MarkdownSlideSet>
-      }
-    </Deck>
-  );
-};

+ 0 - 36
packages/presentation/src/components/Slide.tsx

@@ -1,36 +0,0 @@
-import React, { ReactNode } from 'react';
-
-// import { Marp } from '@marp-team/marp-core';
-import Head from 'next/head';
-
-
-type SlidesProps = {
-  children?: ReactNode,
-}
-
-export const Slides = (props: SlidesProps): JSX.Element => {
-  // const marp = new Marp();
-  // const { css } = marp.render('', { htmlAsArray: true });
-  return (
-    <>
-      <Head>
-        {/* <style>{css}</style> */}
-      </Head>
-      <div className="marpit">{props.children}</div>
-    </>
-  );
-};
-
-type SlideProps = {
-  children?: ReactNode,
-}
-
-export const Slide = (props: SlideProps): JSX.Element => {
-  return (
-    <svg data-marpit-svg viewBox="0 0 1280 960">
-      <foreignObject width="1280" height="960">
-        <section>{props.children}</section>
-      </foreignObject>
-    </svg>
-  );
-};

+ 1 - 3
packages/presentation/src/components/index.ts

@@ -1,3 +1 @@
-// export * from './PresentationWithSpectacle';
-export * from './PresentationWithReveal';
-export * from './Slide';
+export * from './Presentation';

+ 0 - 1
packages/presentation/src/services/renderer/index.ts

@@ -1,2 +1 @@
-// export * from './presentation';
 export * from './hr-splitter';
 export * from './hr-splitter';

+ 0 - 71
packages/presentation/src/services/renderer/presentation.ts

@@ -1,71 +0,0 @@
-import type { Schema as SanitizeOption } from 'hast-util-sanitize';
-import type { Plugin } from 'unified';
-import type { Parent, Node } from 'unist';
-import { findAfter } from 'unist-util-find-after';
-import { visit, EXIT } from 'unist-util-visit';
-
-
-function wrapAllChildrenWithSlides(rootNode: Parent): void {
-  const slides = {
-    type: 'slides',
-    children: rootNode.children,
-    data: {
-      hName: 'slides',
-    },
-  };
-
-  rootNode.children = [slides];
-}
-
-function wrapWithSlide(parentNode: Parent, startElem: Node, endElem: Node | null): void {
-  const siblings = parentNode.children;
-
-  const startIndex = siblings.indexOf(startElem);
-  const endIndex = endElem != null ? siblings.indexOf(endElem) : undefined;
-
-  const between = siblings.slice(
-    startIndex,
-    endIndex,
-  );
-
-  const slide = {
-    type: 'slide',
-    children: between,
-    data: {
-      hName: 'slide',
-    },
-  };
-
-  siblings.splice(startIndex, between.length, slide);
-}
-
-export const remarkPlugin: Plugin = function() {
-  return (tree) => {
-    // wrap with <slides>
-    visit(tree, (node) => {
-      if (node.type === 'root') {
-        const rootNode = node as Parent;
-        wrapAllChildrenWithSlides(rootNode);
-
-        return [EXIT];
-      }
-    });
-
-    // wrap with <slide>
-    visit(
-      tree,
-      node => node.type === 'heading',
-      (node, index, parent: Parent) => {
-        const startElem = node;
-        const endElem = findAfter(parent, startElem, node => node.type === 'heading');
-
-        wrapWithSlide(parent, startElem, endElem);
-      },
-    );
-  };
-};
-
-
-export const sanitizeOption: SanitizeOption = {
-  tagNames: ['slides', 'slide'],
-};

Разница между файлами не показана из-за своего большого размера
+ 20 - 549
yarn.lock


Некоторые файлы не были показаны из-за большого количества измененных файлов