Skip to content

Commit

Permalink
classic -> daniel
Browse files Browse the repository at this point in the history
  • Loading branch information
AdamJaggard committed Sep 22, 2023
1 parent e7a1b60 commit d60e8ba
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 17 deletions.
3 changes: 0 additions & 3 deletions packages/mux-player-react/src/themes/classic.ts

This file was deleted.

3 changes: 3 additions & 0 deletions packages/mux-player-react/src/themes/daniel.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// @ts-ignore
import '@mux/mux-player/themes/daniel';
export default 'daniel';
10 changes: 5 additions & 5 deletions packages/mux-player/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,11 @@
"browser": "./dist/themes/minimal/index.mjs",
"default": "./dist/themes/minimal/index.cjs.js"
},
"./themes/classic": {
"import": "./dist/themes/classic/index.mjs",
"require": "./dist/themes/classic/index.cjs.js",
"browser": "./dist/themes/classic/index.mjs",
"default": "./dist/themes/classic/index.cjs.js"
"./themes/daniel": {
"import": "./dist/themes/daniel/index.mjs",
"require": "./dist/themes/daniel/index.cjs.js",
"browser": "./dist/themes/daniel/index.mjs",
"default": "./dist/themes/daniel/index.cjs.js"
},
"./themes/gerwig": {
"import": "./dist/themes/gerwig/index.mjs",
Expand Down
2 changes: 1 addition & 1 deletion packages/mux-player/scripts/build-themes.mjs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env node
import { build } from 'esbuild';

const themes = ['classic', 'microvideo', 'minimal', 'gerwig'];
const themes = ['daniel', 'microvideo', 'minimal', 'gerwig'];
const devMode = process.argv.includes('--dev');

const shared = {
Expand Down
4 changes: 2 additions & 2 deletions packages/mux-player/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ import { getErrorLogs } from './errors';
import { toNumberOrUndefined, i18n, parseJwt, containsComposedNode, camelCase, kebabCase } from './utils';
import * as logger from './logger';
import type { MuxTemplateProps, ErrorEvent } from './types';
import './themes/classic';
const DefaultThemeName = 'classic';
import './themes/daniel';
const DefaultThemeName = 'daniel';

export { MediaError };
export type Tokens = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!-- prettier-ignore -->
<template id="media-theme-classic">
<template id="media-theme-daniel">
<style>
:host {
--_primary-color: var(--media-primary-color, white);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
// @ts-ignore
import theme from './classic.html';
import theme from './daniel.html';
import { document, globalThis } from '../../polyfills';
import { MediaThemeElement } from 'media-chrome/dist/media-theme-element.js';

const template = document.createElement('template');
if ('innerHTML' in template) template.innerHTML = theme;

class MediaThemeClassic extends MediaThemeElement {
class MediaThemeDaniel extends MediaThemeElement {
static template = template.content?.children?.[0];
}

if (!globalThis.customElements.get('media-theme-classic')) {
globalThis.customElements.define('media-theme-classic', MediaThemeClassic);
if (!globalThis.customElements.get('media-theme-daniel')) {
globalThis.customElements.define('media-theme-daniel', MediaThemeDaniel);
}

export default MediaThemeClassic;
export default MediaThemeDaniel;

0 comments on commit d60e8ba

Please sign in to comment.